mladinox / picoc

Automatically exported from code.google.com/p/picoc
0 stars 0 forks source link

Command-Line argument to print constants [Feature] #103

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Something like this:

 ./chrimp --values

sizeof(char)      {1}
sizeof(short)     {2}
sizeof(int)       {4}
sizeof(long)      {4}
sizeof(double)    {8}
STACKSIZE         <1048576>
NDEBUG            <0>
NULL              [0]
TRUE              [1]
FALSE             [0]
BIG_ENDIAN        [1]
LITTLE_ENDIAN     [0]
CLOCKS_PER_SEC    [1000000]
ALIGN_SIZE        [4]
...
etc

Where:

{?} are sizeof for intrinsic types
<?> are constant which can be set from environment
[?] are hard-code constants (either literals or calculated at compile time) 

This is useful for regular testing, and very useful for cross-system testing.

Original issue reported on code.google.com by duncan.f...@gmail.com on 27 Jul 2010 at 10:22

GoogleCodeExporter commented 8 years ago
Changed to "enhancement"

Original comment by zik.sale...@gmail.com on 27 Jul 2010 at 10:53

GoogleCodeExporter commented 8 years ago
Thanks for the suggestion. I've thought about this one. There's a tension 
between the desire to keep picoc as small as possible and the desire to add 
features. I'll add this feature to my forthcoming "deepc" project instead since 
it's targetted at larger systems.

Original comment by zik.sale...@gmail.com on 18 Feb 2011 at 10:45