--- /dev/null
+#!/bin/bash
+
+set -e
+
+! ! rmdir test_dir && echo "deleted test_dir"
+
+echo "done"
+++ /dev/null
-#include <stdio.h>
-
-// Helper to stringify a macro argument
-#define STR(x) #x
-#define SHOW(x) STR(x)
-
-#define BAD(x ,y) x + y
-#assign (Z ,12)
-//#xassign (Z ,12) // invalid directive
-
-// Macros to test argument parsing and expansion
-#define ZERO() SHOW(ZERO())
-#define ONE(x) SHOW(ONE(x))
-#define TWO(x ,y) SHOW(TWO(x ,y))
-#define VAR(...) SHOW(VAR(__VA_ARGS__))
-#define MIXED(x ,...) SHOW(MIXED(x ,__VA_ARGS__))
-
-int main() {
- int x = BAD(1 ,2); // should work
- printf("x:%x\n" ,x);
-
- // int y = BAD(1 ,2 ,3); // Too many args
- printf("%s\n" ,ZERO()); // "ZERO()"
- printf("%s\n" ,ONE(42)); // "ONE(42)"
- printf("%s\n" ,TWO(a ,b)); // "TWO(a ,b)"
- printf("%s\n" ,VAR()); // "VAR()"
- printf("%s\n" ,VAR(1)); // "VAR(1)"
- printf("%s\n" ,VAR(1 ,2 ,3)); // "VAR(1 ,2 ,3)"
- printf("%s\n" ,MIXED(0)); // "MIXED(0)"
- printf("%s\n" ,MIXED(x ,y ,z)); // "MIXED(x ,y ,z)"
- printf("%s\n" ,ONE((1 ,2))); // "ONE((1 ,2))"
- printf("%s\n" ,VAR((a ,b) ,c)); // "VAR((a ,b) ,c)"
- return 0;
-}
#include <stdio.h>
-// Helper to stringify a macro argument
-#define STR(x) #x
-#define SHOW(x) STR(x)
-
-#define BAD(x ,y) x + y
-#assign (Z ,12)
-//#xassign (Z ,12) // invalid directive
-
-// Macros to test argument parsing and expansion
-#define ZERO() SHOW(ZERO())
-#define ONE(x) SHOW(ONE(x))
-#define TWO(x ,y) SHOW(TWO(x ,y))
-#define VAR(...) SHOW(VAR(__VA_ARGS__))
-#define MIXED(x ,...) SHOW(MIXED(x ,__VA_ARGS__))
-
int main() {
- int x = BAD(1 ,2); // should work
- printf("x:%x\n" ,x);
-
- // int y = BAD(1 ,2 ,3); // Too many args
- printf("%s\n" ,ZERO()); // "ZERO()"
- printf("%s\n" ,ONE(42)); // "ONE(42)"
- printf("%s\n" ,TWO(a ,b)); // "TWO(a ,b)"
- printf("%s\n" ,VAR()); // "VAR()"
- printf("%s\n" ,VAR(1)); // "VAR(1)"
- printf("%s\n" ,VAR(1 ,2 ,3)); // "VAR(1 ,2 ,3)"
- printf("%s\n" ,MIXED(0)); // "MIXED(0)"
- printf("%s\n" ,MIXED(x ,y ,z)); // "MIXED(x ,y ,z)"
- printf("%s\n" ,ONE((1 ,2))); // "ONE((1 ,2))"
- printf("%s\n" ,VAR((a ,b) ,c)); // "VAR((a ,b) ,c)"
return 0;
}
--- /dev/null
+ .file "try_assign_0.c"
+ .text
+ .globl main
+ .type main, @function
+main:
+.LFB0:
+ .cfi_startproc
+ pushq %rbp
+ .cfi_def_cfa_offset 16
+ .cfi_offset 6, -16
+ movq %rsp, %rbp
+ .cfi_def_cfa_register 6
+ movl $0, %eax
+ popq %rbp
+ .cfi_def_cfa 7, 8
+ ret
+ .cfi_endproc
+.LFE0:
+ .size main, .-main
+ .ident "GCC: (Debian 12.2.0-14) 12.2.0"
+ .section .note.GNU-stack,"",@progbits
+++ /dev/null
-#include <stdio.h>
-
-#define N32· N96·
-
-int N96·i = 10;
-int N32·j = 20;
-
-int main(){
- printf("N96·i :%x\n",N96·i);
- printf("N32·j :%x\n",N96·j);
- return 0;
-}
-
-/*
-
- try_parameter.c:10:24: error: ‘N96·j’ undeclared (first use in this function); did you mean ‘N96·i’?
- 10 | printf("N32·j :%x\n",N96·j);
- | ^~~~~
- | N96·i
-
-As of C99 a macro must have a space after it, so the `N32·` of `N32·j` is not being recognized.
-
-
-*/
+++ /dev/null
-// experiment/test_pragma_macro.c
-
-#include <stdio.h>
-
-// -- STEP 1: Should compile even if pragma is ignored
-#pragma message("Compiling test_pragma_macro.c")
-
-#define A AMACRO
-
-#pragma macro(A)
-
-// Uncomment to test extension behavior:
-// Expected behavior: defines MY_MACRO to have body "42"
-// Expected fallback: compiler error or ignored pragma
-// #pragma name(MY_MACRO, 42)
-
-#ifndef MY_MACRO
-#define MY_MACRO -1
-#endif
-
-int main(void) {
- printf("MY_MACRO expands to: %d\n", MY_MACRO);
-
- #ifdef AMACRO
- printf("AMACRO DEFINED!");
- #endif
- return 0;
-}
-
-/*
-nvoking a non-existing pragma is ignored without the -Wall
-
-2025-05-01T13:29:48Z[developer]
-Thomas-developer@StanleyPark§/home/Thomas/subu_data/developer/N/developer/experiment§
-> gcc -Wall try_pragma_macro.c
-try_pragma_macro.c:6:9: note: ‘#pragma message: Compiling test_pragma_macro.c’
- 6 | #pragma message("Compiling test_pragma_macro.c")
- | ^~~~~~~
-try_pragma_macro.c:11: warning: ignoring ‘#pragma macro ’ [-Wunknown-pragmas]
- 11 | #pragma macro(A)
- |
-
-*/