// originally from w1/a1.c, modified to use disp() macro // #include #include // # is preproc stringify operator // #define disp( what, format) printf( #what " = " format "\n", what) int main(void) { // printf( " LONG_MAX = %li\n", LONG_MAX); disp( LONG_MAX, "%li"); /* improved: char *fname = "/etc/shadow"; errno = 0; FILE *fp = fopen(fname,"r"); int e = errno; if( fp == 0) { perror(fname); return 1; } printf( "errno = %i\n", e); int c = fgetc(fp); printf( "c = %i\n", c); */ return 0; } /* sample run: $ alias GCC gcc -std=c11 -pedantic -Wall $ GCC -E a1.c | grep LONG_MAX printf( "LONG_MAX" " = " "%li" "\n", 0x7fffffffffffffffL); $ GCC a1.c $ ./a.out LONG_MAX = 9223372036854775807 $ */