From: Thomas Walker Lynch Date: Thu, 1 May 2025 13:38:30 +0000 (+0000) Subject: establishes baseline before customizing gcc16 for our 'macro' pragma X-Git-Url: https://git.reasoningtechnology.com/usr/lib/python2.7/hashlib.py?a=commitdiff_plain;h=9877e690fdc6eb231213991aecb2505e470f0c27;p=N establishes baseline before customizing gcc16 for our 'macro' pragma --- diff --git "a/developer/cc\360\237\226\211/ParameterConnector.lib.c" "b/developer/cc\360\237\226\211/ParameterConnector.lib.c" index 86f2591..f0db395 100644 --- "a/developer/cc\360\237\226\211/ParameterConnector.lib.c" +++ "b/developer/cc\360\237\226\211/ParameterConnector.lib.c" @@ -30,24 +30,27 @@ Declares a parameter connector, does not initialize it. Expands to: (tm.pft->function_name)(tm ,arg1 ,arg2, ...) note the use of the comma operator to return the result from the b.pft->fn call + + pc - parameter connector + PC - generic parameter connector type, though as the parameter connector is the entry point for dispatch, we give it the name of Model/Machine type. */ #ifdef ParameterConnector·DEBUG #include - #define ParameterConnector·call(pc_instance ,fn ,...) ( \ - assert((pc_instance).pft != NULL) \ - ,assert((pc_instance).tableau != NULL) \ - ,(b).pft->fn(b __VA_OPT__(,) __VA_ARGS__) \ + #define ParameterConnector·call(pc ,fn ,...) ( \ + assert((pc).pft != NULL) \ + ,assert((pc).state_parameter != NULL) \ + ,(pc).pft->fn(pc __VA_OPT__(,) __VA_ARGS__) \ ) #else - #define ParameterConnector·call(pc_instance ,fn ,...) \ - (pc_instance).pft->fn(pc_instance __VA_OPT__(,) __VA_ARGS__) + #define ParameterConnector·call(pc ,fn ,...) \ + (pc).pft->fn(pc __VA_OPT__(,) __VA_ARGS__) #endif #define ParameterConnector·DECLARE(type) \ typedef struct ·(type ,PFT) ·(type ,PFT); \ - typedef struct ·(type ,Tableau) ·(type ,Tableau); \ + typedef struct ·(type ,StateParameter) ·(type ,StateParameter); \ typedef struct type { \ - ·(type ,Tableau) *tableau; \ + ·(type ,StateParameter) *state_parameter; \ ·(type ,PFT) *pft; \ } type; diff --git "a/developer/cc\360\237\226\211/TM\302\267Array.lib.c" "b/developer/cc\360\237\226\211/TM\302\267Array.lib.c" index a8fd814..f9ce008 100644 --- "a/developer/cc\360\237\226\211/TM\302\267Array.lib.c" +++ "b/developer/cc\360\237\226\211/TM\302\267Array.lib.c" @@ -23,12 +23,13 @@ #endif -// once per _TM·CVT_ value -// Caller must #define SET_TM·Array·, after inclusion, to prevent re-inclusion +// only include this file once per _TM·CVT_ value #ifdef _TM·CVT_ -#if BOOLEAN( NOT_IN(TM·Array ,_TM·CVT_) ) - #include "TM.Lib.c" + #if BOOLEAN( NOT_IN(TM ,_TM·CVT_) ) + #include "TM.Lib.c" + #define SET__ + #endif #pragma push(T) #pragma push(TA) @@ -46,16 +47,16 @@ _TM·CVT_ *hd; _TM·CVT_ *position; TE extent; - } ·(TA,Tableau); + } ·(TA,StateParameter); // call signatures for the initialization functions // T ·(TA,init_pe)( - ·(TA,Tableau) *t ,_TM·CVT_ position[] ,TE extent + ·(TA,StateParameter) *t ,_TM·CVT_ position[] ,TE extent ); T ·(TA,init_pp)( - ·(TA,Tableau) *t ,_TM·CVT_ *position_left ,_TM·CVT_ *position_right + ·(TA,StateParameter) *t ,_TM·CVT_ *position_left ,_TM·CVT_ *position_right ); #pragma pop(T) @@ -95,21 +96,21 @@ #endif Local TM·Topo ·(TA,topo)(T tm){ - ·(TM,_TM·CVT_,Array,Tableau) *t = (·(TM,_TM·CVT_,Array,Tableau) *) tm.tableau; + ·(TA,StateParameter) *t = (·(TA,StateParameter) *) tm.state_parameter; if( t->extent == 0 ) return TM·Topo·singleton; return TM·Topo·segment; } Local bool ·(TA,bounded)(T tm){ - ·(TA,Tableau) *t = (·(TA,Tableau) *) tm.tableau; + ·(TA,StateParameter) *t = (·(TA,StateParameter) *) tm.state_parameter; return ·(TA,topo)(tm) & TM·Topo·bounded; } Local TE ·(TA,extent)(T tm){ - ·(TA,Tableau) *t = (·(TA,Tableau) *) tm.tableau; + ·(TA,StateParameter) *t = (·(TA,StateParameter) *) tm.state_parameter; return t->extent; } Local TM·Status ·(TA,status)(T tm){ - ·(TA,Tableau) *t = (·(TA,Tableau) *) tm.tableau; + ·(TA,StateParameter) *t = (·(TA,StateParameter) *) tm.state_parameter; if( !t->hd ) return TM·Status·dismounted; if( t->hd == t->position ) return TM·Status·leftmost; @@ -139,39 +140,39 @@ // does nothing if tape is already mounted Local void ·(TA,mount)(T tm){ - ·(TA,Tableau) *t = (·(TA,Tableau) *) tm.tableau; + ·(TA,StateParameter) *t = (·(TA,StateParameter) *) tm.state_parameter; if( !t->hd ) t->hd = t->position; } Local void ·(TA,dismount)(T tm){ - ·(TA,Tableau) *t = (·(TA,Tableau) *) tm.tableau; + ·(TA,StateParameter) *t = (·(TA,StateParameter) *) tm.state_parameter; t->hd = NULL; } Local void ·(TA,step)(T tm){ - ·(TA,Tableau) *t = (·(TA,Tableau) *) tm.tableau; + ·(TA,StateParameter) *t = (·(TA,StateParameter) *) tm.state_parameter; t->hd++; } Local void ·(TA,step_left)(T tm){ - ·(TA,Tableau) *t = (·(TA,Tableau) *) tm.tableau; + ·(TA,StateParameter) *t = (·(TA,StateParameter) *) tm.state_parameter; t->hd--; } // rewind does nothing if the tape is dismounted Local void ·(TA,rewind)(T tm){ - ·(TA,Tableau) *t = (·(TA,Tableau) *) tm.tableau; + ·(TA,StateParameter) *t = (·(TA,StateParameter) *) tm.state_parameter; if( ·(TA,dismounted)( tm ) ) return; t->hd = t->position; } Local _TM·CVT_ ·(TA,read)(T tm){ - ·(TA,Tableau) *t = (·(TA,Tableau) *) tm.tableau; + ·(TA,StateParameter) *t = (·(TA,StateParameter) *) tm.state_parameter; return *t->hd; } Local void ·(TA,write)(T tm ,_TM·CVT_ *remote_pt){ - ·(TA,Tableau) *t = (·(TA,Tableau) *) tm.tableau; + ·(TA,StateParameter) *t = (·(TA,StateParameter) *) tm.state_parameter; *t->hd = *remote_pt; } @@ -203,7 +204,7 @@ tm is up casted from being array specific, to being generic. Later it is downcasted within the array code before being used. This can be seen at the top of each of the array specific function. This is the only loss of static type safety, and it is embedded in the library code. */ ·(TM,_TM·CVT_) ·(TA,init_pe)( - ·(TA,Tableau) *t + ·(TA,StateParameter) *t ,_TM·CVT_ *position ,TE extent ){ @@ -212,7 +213,7 @@ t->extent = extent; T tm = { - .tableau = (·(TM,_TM·CVT_,Tableau) *)t + .state_parameter = (·(TM,_TM·CVT_,StateParameter) *)t ,.pft = &·(TA,pft) }; @@ -220,7 +221,7 @@ } ·(TM,_TM·CVT_) ·(TA,init_pp)( - ·(TA,Tableau) *t + ·(TA,StateParameter) *t ,_TM·CVT_ *position_left ,_TM·CVT_ *position_right ){ diff --git "a/developer/cc\360\237\226\211/TM\302\267SingletonCircle.lib.c" "b/developer/cc\360\237\226\211/TM\302\267SingletonCircle.lib.c" index ee7abe7..6e375ea 100644 --- "a/developer/cc\360\237\226\211/TM\302\267SingletonCircle.lib.c" +++ "b/developer/cc\360\237\226\211/TM\302\267SingletonCircle.lib.c" @@ -37,10 +37,10 @@ typedef struct{ bool hd; _TM·CVT_ value; - } ·(TM,_TM·CVT_,SingletonCircle,Tableau); + } ·(TM,_TM·CVT_,SingletonCircle,StateParameter); ·(TM,_TM·CVT_) ·(TM,_TM·CVT_,SingletonCircle,init)( - ·(TM,_TM·CVT_,SingletonCircle,Tableau) *t + ·(TM,_TM·CVT_,SingletonCircle,StateParameter) *t ,_TM·CVT_ initial_value ); @@ -76,18 +76,18 @@ return 0; } Local TM·Status ·(TM,_TM·CVT_,SingletonCircle,status)( ·(TM,_TM·CVT_) tm ){ - ·(TM,_TM·CVT_,SingletonCircle,Tableau) *t = (·(TM,_TM·CVT_,SingletonCircle,Tableau) *) tm.tableau; + ·(TM,_TM·CVT_,SingletonCircle,StateParameter) *t = (·(TM,_TM·CVT_,SingletonCircle,StateParameter) *) tm.state_parameter; if( !t->hd ) return TM·Status·dismounted; return TM·Status·interim; } Local bool ·(TM,_TM·CVT_,SingletonCircle,dismounted)( ·(TM,_TM·CVT_) tm ){ - ·(TM,_TM·CVT_,SingletonCircle,Tableau) *t = (·(TM,_TM·CVT_,SingletonCircle,Tableau) *) tm.tableau; + ·(TM,_TM·CVT_,SingletonCircle,StateParameter) *t = (·(TM,_TM·CVT_,SingletonCircle,StateParameter) *) tm.state_parameter; return !t->hd; } // these could be pulled from the tm.pft table, and defined once Local bool ·(TM,_TM·CVT_,SingletonCircle,on_tape)( ·(TM,_TM·CVT_) tm ){ - ·(TM,_TM·CVT_,SingletonCircle,Tableau) *t = (·(TM,_TM·CVT_,SingletonCircle,Tableau) *) tm.tableau; + ·(TM,_TM·CVT_,SingletonCircle,StateParameter) *t = (·(TM,_TM·CVT_,SingletonCircle,StateParameter) *) tm.state_parameter; return t->hd; } Local bool ·(TM,_TM·CVT_,SingletonCircle,on_leftmost)( ·(TM,_TM·CVT_) tm ){ @@ -99,11 +99,11 @@ // does nothing if tape is already mounted Local void ·(TM,_TM·CVT_,SingletonCircle,mount)( ·(TM,_TM·CVT_) tm ){ - ·(TM,_TM·CVT_,SingletonCircle,Tableau) *t = (·(TM,_TM·CVT_,SingletonCircle,Tableau) *) tm.tableau; + ·(TM,_TM·CVT_,SingletonCircle,StateParameter) *t = (·(TM,_TM·CVT_,SingletonCircle,StateParameter) *) tm.state_parameter; t->hd = true; } Local void ·(TM,_TM·CVT_,SingletonCircle,dismount)( ·(TM,_TM·CVT_) tm ){ - ·(TM,_TM·CVT_,SingletonCircle,Tableau) *t = (·(TM,_TM·CVT_,SingletonCircle,Tableau) *) tm.tableau; + ·(TM,_TM·CVT_,SingletonCircle,StateParameter) *t = (·(TM,_TM·CVT_,SingletonCircle,StateParameter) *) tm.state_parameter; t->hd = false; } @@ -118,11 +118,11 @@ } Local _TM·CVT_ ·(TM,_TM·CVT_,SingletonCircle,r)( ·(TM,_TM·CVT_) tm ){ - ·(TM,_TM·CVT_,SingletonCircle,Tableau) *t = (·(TM,_TM·CVT_,SingletonCircle,Tableau) *) tm.tableau; + ·(TM,_TM·CVT_,SingletonCircle,StateParameter) *t = (·(TM,_TM·CVT_,SingletonCircle,StateParameter) *) tm.state_parameter; return t->value; } Local void ·(TM,_TM·CVT_,SingletonCircle,w)( ·(TM,_TM·CVT_) tm ,_TM·CVT_ *remote_pt ){ - ·(TM,_TM·CVT_,SingletonCircle,Tableau) *t = (·(TM,_TM·CVT_,SingletonCircle,Tableau) *) tm.tableau; + ·(TM,_TM·CVT_,SingletonCircle,StateParameter) *t = (·(TM,_TM·CVT_,SingletonCircle,StateParameter) *) tm.state_parameter; t->value = *remote_pt; } @@ -154,14 +154,14 @@ tm is up casted from being array specific, to being generic. Later it is downcasted within the array code before being used. This can be seen at the top of each of the array specific function. This is the only loss of static type safety, and it is embedded in the library code. */ ·(TM,_TM·CVT_) ·(TM,_TM·CVT_,SingletonCircle,init)( - ·(TM,_TM·CVT_,SingletonCircle,Tableau) *t + ·(TM,_TM·CVT_,SingletonCircle,StateParameter) *t ,_TM·CVT_ initial_value ){ t->hd = true; t->value = initial_value; ·(TM,_TM·CVT_) tm = { - .tableau = (·(TM,_TM·CVT_,Tableau) *)t + .state_parameter = (·(TM,_TM·CVT_,StateParameter) *)t ,.pft = &·(TM,_TM·CVT_,SingletonCircle,pft) }; diff --git "a/developer/cc\360\237\226\211/TM\302\267SingletonSegment.lib.c" "b/developer/cc\360\237\226\211/TM\302\267SingletonSegment.lib.c" index 90d55f7..1dff957 100644 --- "a/developer/cc\360\237\226\211/TM\302\267SingletonSegment.lib.c" +++ "b/developer/cc\360\237\226\211/TM\302\267SingletonSegment.lib.c" @@ -34,10 +34,10 @@ typedef struct{ bool hd; _TM·CVT_ value; - } ·(TM,_TM·CVT_,SingletonSegment,Tableau); + } ·(TM,_TM·CVT_,SingletonSegment,StateParameter); ·(TM,_TM·CVT_) ·(TM,_TM·CVT_,SingletonSegment,init)( - ·(TM,_TM·CVT_,SingletonSegment,Tableau) *t + ·(TM,_TM·CVT_,SingletonSegment,StateParameter) *t ,_TM·CVT_ initial_value ); @@ -73,12 +73,12 @@ return 0; } Local TM·Status ·(TM,_TM·CVT_,SingletonSegment,status)( ·(TM,_TM·CVT_) tm ){ - ·(TM,_TM·CVT_,SingletonSegment,Tableau) *t = (·(TM,_TM·CVT_,SingletonSegment,Tableau) *) tm.tableau; + ·(TM,_TM·CVT_,SingletonSegment,StateParameter) *t = (·(TM,_TM·CVT_,SingletonSegment,StateParameter) *) tm.state_parameter; if( !t->hd ) return TM·Status·dismounted; return TM·Status·leftmost | TM·Status·rightmost; } Local bool ·(TM,_TM·CVT_,SingletonSegment,dismounted)( ·(TM,_TM·CVT_) tm ){ - ·(TM,_TM·CVT_,SingletonSegment,Tableau) *t = (·(TM,_TM·CVT_,SingletonSegment,Tableau) *) tm.tableau; + ·(TM,_TM·CVT_,SingletonSegment,StateParameter) *t = (·(TM,_TM·CVT_,SingletonSegment,StateParameter) *) tm.state_parameter; return !t->hd; } @@ -95,11 +95,11 @@ // does nothing if tape is already mounted Local void ·(TM,_TM·CVT_,SingletonSegment,mount)( ·(TM,_TM·CVT_) tm ){ - ·(TM,_TM·CVT_,SingletonSegment,Tableau) *t = (·(TM,_TM·CVT_,SingletonSegment,Tableau) *) tm.tableau; + ·(TM,_TM·CVT_,SingletonSegment,StateParameter) *t = (·(TM,_TM·CVT_,SingletonSegment,StateParameter) *) tm.state_parameter; t->hd = true; } Local void ·(TM,_TM·CVT_,SingletonSegment,dismount)( ·(TM,_TM·CVT_) tm ){ - ·(TM,_TM·CVT_,SingletonSegment,Tableau) *t = (·(TM,_TM·CVT_,SingletonSegment,Tableau) *) tm.tableau; + ·(TM,_TM·CVT_,SingletonSegment,StateParameter) *t = (·(TM,_TM·CVT_,SingletonSegment,StateParameter) *) tm.state_parameter; t->hd = false; } @@ -114,11 +114,11 @@ } Local _TM·CVT_ ·(TM,_TM·CVT_,SingletonSegment,r)( ·(TM,_TM·CVT_) tm ){ - ·(TM,_TM·CVT_,SingletonSegment,Tableau) *t = (·(TM,_TM·CVT_,SingletonSegment,Tableau) *) tm.tableau; + ·(TM,_TM·CVT_,SingletonSegment,StateParameter) *t = (·(TM,_TM·CVT_,SingletonSegment,StateParameter) *) tm.state_parameter; return t->value; } Local void ·(TM,_TM·CVT_,SingletonSegment,w)( ·(TM,_TM·CVT_) tm ,_TM·CVT_ *remote_pt ){ - ·(TM,_TM·CVT_,SingletonSegment,Tableau) *t = (·(TM,_TM·CVT_,SingletonSegment,Tableau) *) tm.tableau; + ·(TM,_TM·CVT_,SingletonSegment,StateParameter) *t = (·(TM,_TM·CVT_,SingletonSegment,StateParameter) *) tm.state_parameter; t->value = *remote_pt; } @@ -150,14 +150,14 @@ tm is up casted from being array specific, to being generic. Later it is downcasted within the array code before being used. This can be seen at the top of each of the array specific function. This is the only loss of static type safety, and it is embedded in the library code. */ ·(TM,_TM·CVT_) ·(TM,_TM·CVT_,SingletonSegment,init)( - ·(TM,_TM·CVT_,SingletonSegment,Tableau) *t + ·(TM,_TM·CVT_,SingletonSegment,StateParameter) *t ,_TM·CVT_ initial_value ){ t->hd = true; t->value = initial_value; ·(TM,_TM·CVT_) tm = { - .tableau = (·(TM,_TM·CVT_,Tableau) *)t + .state_parameter = (·(TM,_TM·CVT_,StateParameter) *)t ,.pft = &·(TM,_TM·CVT_,SingletonSegment,pft) }; diff --git "a/developer/cc\360\237\226\211/TM\302\267ZeroLength.lib.c" "b/developer/cc\360\237\226\211/TM\302\267ZeroLength.lib.c" index 861c7a9..4506cc6 100644 --- "a/developer/cc\360\237\226\211/TM\302\267ZeroLength.lib.c" +++ "b/developer/cc\360\237\226\211/TM\302\267ZeroLength.lib.c" @@ -33,10 +33,10 @@ typedef struct{ bool hd; - } ·(TM,_TM·CVT_,ZeroLength,Tableau); + } ·(TM,_TM·CVT_,ZeroLength,StateParameter); ·(TM,_TM·CVT_) ·(TM,_TM·CVT_,ZeroLength,init)( - ·(TM,_TM·CVT_,ZeroLength,Tableau) *t + ·(TM,_TM·CVT_,ZeroLength,StateParameter) *t ); #endif @@ -74,13 +74,13 @@ } Local TM·Status ·(TM,_TM·CVT_,ZeroLength,status)( ·(TM,_TM·CVT_) tm ){ - ·(TM,_TM·CVT_,ZeroLength,Tableau) *t = (·(TM,_TM·CVT_,ZeroLength,Tableau) *) tm.tableau; + ·(TM,_TM·CVT_,ZeroLength,StateParameter) *t = (·(TM,_TM·CVT_,ZeroLength,StateParameter) *) tm.state_parameter; if( !t->hd ) return TM·Status·dismounted; return TM·Status·out_of_area; } Local bool ·(TM,_TM·CVT_,ZeroLength,dismounted)( ·(TM,_TM·CVT_) tm ){ - ·(TM,_TM·CVT_,ZeroLength,Tableau) *t = (·(TM,_TM·CVT_,ZeroLength,Tableau) *) tm.tableau; + ·(TM,_TM·CVT_,ZeroLength,StateParameter) *t = (·(TM,_TM·CVT_,ZeroLength,StateParameter) *) tm.state_parameter; return !t->hd; } @@ -98,12 +98,12 @@ // does nothing if tape is already mounted Local void ·(TM,_TM·CVT_,ZeroLength,mount)( ·(TM,_TM·CVT_) tm ){ - ·(TM,_TM·CVT_,ZeroLength,Tableau) *t = (·(TM,_TM·CVT_,ZeroLength,Tableau) *) tm.tableau; + ·(TM,_TM·CVT_,ZeroLength,StateParameter) *t = (·(TM,_TM·CVT_,ZeroLength,StateParameter) *) tm.state_parameter; if( !t->hd ) t->hd = true; } Local void ·(TM,_TM·CVT_,ZeroLength,dismount)( ·(TM,_TM·CVT_) tm ){ - ·(TM,_TM·CVT_,ZeroLength,Tableau) *t = (·(TM,_TM·CVT_,ZeroLength,Tableau) *) tm.tableau; + ·(TM,_TM·CVT_,ZeroLength,StateParameter) *t = (·(TM,_TM·CVT_,ZeroLength,StateParameter) *) tm.state_parameter; t->hd = false; } @@ -117,7 +117,7 @@ // rewind does nothing if the tape is dismounted Local void ·(TM,_TM·CVT_,ZeroLength,rewind)( ·(TM,_TM·CVT_) tm ){ - ·(TM,_TM·CVT_,ZeroLength,Tableau) *t = (·(TM,_TM·CVT_,ZeroLength,Tableau) *) tm.tableau; + ·(TM,_TM·CVT_,ZeroLength,StateParameter) *t = (·(TM,_TM·CVT_,ZeroLength,StateParameter) *) tm.state_parameter; if( ·(TM,_TM·CVT_,ZeroLength,dismounted)( tm ) ) return; assert(0); } @@ -155,11 +155,11 @@ }; ·(TM,_TM·CVT_) ·(TM,_TM·CVT_,ZeroLength,init)( - ·(TM,_TM·CVT_,ZeroLength,Tableau) *t + ·(TM,_TM·CVT_,ZeroLength,StateParameter) *t ){ t->hd = true; ·(TM,_TM·CVT_) tm = { - .tableau = (·(TM,_TM·CVT_,Tableau) *)t + .state_parameter = (·(TM,_TM·CVT_,StateParameter) *)t ,.pft = &·(TM,_TM·CVT_,ZeroLength,pft) }; return tm; diff --git "a/developer/cc\360\237\226\211/scratch.c" "b/developer/cc\360\237\226\211/scratch.c" new file mode 100644 index 0000000..1e39535 --- /dev/null +++ "b/developer/cc\360\237\226\211/scratch.c" @@ -0,0 +1,7 @@ +// #if BOOLEAN( NOT_IN(TM·Array ,_TM·CVT_) ) +// #include ... +// #define ... +// + + +#if BOOLEAN( NOT_IN(TM·Array ,_TM·CVT_) ) diff --git a/developer/experiment/try_pragma_macro.c b/developer/experiment/try_pragma_macro.c new file mode 100644 index 0000000..2cc0723 --- /dev/null +++ b/developer/experiment/try_pragma_macro.c @@ -0,0 +1,43 @@ +// experiment/test_pragma_macro.c + +#include + +// -- 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) + | + +*/ diff --git "a/tool_shared/bespoke\360\237\226\211/env" "b/tool_shared/bespoke\360\237\226\211/env" index 0ab3899..6e4e025 100644 --- "a/tool_shared/bespoke\360\237\226\211/env" +++ "b/tool_shared/bespoke\360\237\226\211/env" @@ -29,25 +29,39 @@ shopt -s nullglob # set the prompt decoration to the name of the project PROMPT_DECOR=$PROJECT - # include the project bespoke tools - PATH="$REPO_HOME"/tool_shared/bespoke🖉:"$PATH" - - export REPO_HOME PROJECT PROMPT_DECOR PATH + export REPO_HOME PROJECT PROMPT_DECOR # -------------------------------------------------------------------------------- -# The project administrator sets up the following tools for all roles to use: +# tool chain # PATH="$REPO_HOME/tool_shared/third_party/RT-project-share/release/bash:$PATH" PATH="$REPO_HOME/tool_shared/third_party/RT-project-share/release/amd64:$PATH" PATH="$REPO_HOME/tool_shared/third_party/emacs/bin:$PATH" - - # after having installed Itellij IDEA PATH="$REPO_HOME/tool_shared/third_party/idea-IC-243.21565.193/bin:$PATH" + PATH="$REPO_HOME/tool_shared/third_party:$PATH" + + gcc_16=/home/Thomas/subu_data/developer/N/tool_shared/customized/gcc_16 + PATH="$gcc_16":"$PATH" + + PATH="$REPO_HOME/tool_shared/customized:$PATH" + PATH="$REPO_HOME"/tool_shared/bespoke🖉:"$PATH" + + # Remove duplicates and export path + clean_path() { + PATH=$(echo ":$PATH" | awk -v RS=: -v ORS=: '!seen[$0]++' | sed 's/^://; s/:$//') + } + clean_path + export PATH + + # Toolchain roots + export JAVA_HOME="$REPO_HOME/tool_shared/third_party/jdk-23.0.1" + export MOSAIC_HOME="$REPO_HOME/tool_shared/third_party/Mosaic" - JAVA_HOME="$REPO_HOME/tool_shared/third_party/jdk-23.0.1" - MOSAIC_HOME="$REPO_HOME/tool_shared/third_party/Mosaic" + // for the customized gcc/cpp + export LIBRARY_PATH=$gcc_16/lib + export C_INCLUDE_PATH=$gcc_16/include + export LD_LIBRARY_PATH=$gcc_16/lib - export PATH JAVA_HOME MOSAIC_HOME # -------------------------------------------------------------------------------- # the following functions are provided for other scripts to use. diff --git a/tool_shared/customized/install b/tool_shared/customized/install new file mode 120000 index 0000000..9028162 --- /dev/null +++ b/tool_shared/customized/install @@ -0,0 +1 @@ +/home/Thomas/subu_data/developer/pragma_macro/install \ No newline at end of file diff --git "a/tool_shared/document\360\237\226\211/install.txt" "b/tool_shared/document\360\237\226\211/install.txt" index 5897489..b3b03b8 100644 --- "a/tool_shared/document\360\237\226\211/install.txt" +++ "b/tool_shared/document\360\237\226\211/install.txt" @@ -1,15 +1,9 @@ ----------------------------------------- -RT-project-share - - lrwxrwxrwx. 1 Thomas-developer Thomas-developer 41 2025-01-22 06:29 emacs_30.0.92 -> /home/Thomas-masu/developer/emacs_30.0.92 - lrwxrwxrwx. 1 Thomas-developer Thomas-developer 45 2025-01-22 06:29 RT-project-share -> /home/Thomas-masu/developer/RT-project-share/ - ---------------------------------------- -# for downloads of tar files etc. for third party tools : +for downloads of tar files etc. for third party tools : + drwx------. 1 Thomas-developer Thomas-developer 354 2024-12-09 02:45 upstream - ---------------------------------------- generally when installing third party tools from a repo @@ -17,3 +11,55 @@ generally when installing third party tools from a repo cd tools_shared/third_party git clone cd project + +---------------------------------------- +RT-project-share + + lrwxrwxrwx. 1 Thomas-developer Thomas-developer 45 2025-01-22 06:29 RT-project-share -> /home/Thomas-masu/developer/RT-project-share/ + + lrwxrwxrwx. 1 Thomas-developer Thomas-developer 41 2025-01-22 06:29 emacs_30.0.92 -> /home/Thomas-masu/developer/emacs_30.0.92 + +---------------------------------------- +emacs + + lrwxrwxrwx. 1 Thomas-developer Thomas-developer 41 2025-01-22 06:29 emacs_30.0.92 -> /home/Thomas-masu/developer/emacs_30.0.92 + + Usually I'm running a shell inside of emacs, so I have already run + emacs before arriving at the project. + + There was a reason for the local project version of emacs, but I forget what it was. + Perhaps need for a newer version? It is not otherwise integrated into the project. + +---------------------------------------- +gcc + + I modified cpp to add #pragma macro(name ,body) + + Where `name` is expanded and the fist token used as the nane of the macro. + + `body` is also expanded. If 'name' appears in it, then it will be expanded with + its old definition (prior to running `#pragma macro(name ,body). + + If name already exists in the symbol table, it is updated with the new macro definition. + + To install: + + make sure `pragma_macro` project is installed and built. This provides gcc + to multiple projects, so it is at the top level ~/pragma_macro. + + gcc_16=/home/Thomas/subu_data/developer/N/tool_shared/customized/gcc_16 + + cd $REPO_HOME/tool_shared/customized + ln -s /home/Thomas/subu_data/developer/pragma_macro/install $gcc_16 + + place in bespoke🖉/env: + export PATH=$gcc_16:$PATH + export LIBRARY_PATH=$gcc_16/lib + export C_INCLUDE_PATH=$gcc_16/include + export LD_LIBRARY_PATH=$gcc_16/lib + + + + + +