{"thread":{"id":"12026","subject":"C-compiler features","startedAt":"2008-02-11T08:03:26Z","lastAt":"2008-02-11T16:24:14Z","messageCount":2,"participants":["H.Merijn Brand","Daniel Barkalow"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"68337","messageId":"20080211090326.2d0c64cd@pc09.procura.nl","threadId":"12026","inReplyTo":null,"subject":"C-compiler features","fromName":"H.Merijn Brand","fromEmail":"h.m.brand@xs4all.nl","sentAt":"2008-02-11T08:03:26Z","receivedAt":"2008-02-11T08:03:26Z","isPatch":false,"sender":{"key":"h.m.brand@xs4all.nl","avatar":"https://gravatar.com/avatar/5b8f83ee35c427a646cbea3b104346e00ab3663b99bbf435cddeb75cd4b3857b?d=mp&s=160"},"body":"Having to answer questions about my C-compiler isn't always that easy.\nSometimes you need to find include files, for which you don't know if\nand if how they are used. Sometimes you need to compile test programs\nto see the behaviour, and then there is threads, 32/64 bitness etc.\n\nI was recently pointed to http://www.math.utah.edu/pub/features/\nWhich gives a nice summary of what your C/C++ compiler behaves like.\nHere's the output for HP C-ANSI-C on HP-UX 11.23/64 IPF and on 11.00\n\n========================================================================\nHP-UX 11.23/64 U  rx1620/64 Itanium 2/1600(2) ia64  2037 Mb\nB9007AA.C-ANSI-C  C.06.15   HP C/aC++ Compiler\n\n\nCompiler                             = cc\n\n\nAvailable standard predefined constant macros...\n        __DATE__                     = \"Feb 11 2008\"\n        __FILE__                     = \"features.c\"\n        __LINE__                     =      180\n        __STDC__                     =        1\n        __STDC_VERSION__             =   199012\n        __TIME__                     = \"08:50:58\"\n\n\nMissing standard predefined constant macros...\n        __bool_true_false_are_defined\n        __cplusplus\n        __func__\n        __STDC_HOSTED__\n        __STDC_IEC_559__\n        __STDC_IEC_559_COMPLEX__\n        __STDC_ISO_10646__\n        __STDC_CONSTANT_MACROS\n        __STDC_FORMAT_MACROS\n        __STDC_LIMIT_MACROS\n\n\nAvailable nonstandard but traditional header files...\n        <sys/types.h>\n        <varargs.h>\n\n\nMissing nonstandard but traditional header files...\n\n\nAvailable 1989 Standard C header files...\n        <assert.h>\n        <ctype.h>\n        <errno.h>\n        <float.h>\n        <limits.h>\n        <locale.h>\n        <math.h>\n        <setjmp.h>\n        <signal.h>\n        <stdarg.h>\n        <stddef.h>\n        <stdio.h>\n        <stdlib.h>\n        <string.h>\n        <time.h>\n\n\nMissing 1989 Standard C standard header files...\n\n\nAvailable additional 1999 Standard C header files...\n        <complex.h>\n        <fenv.h>\n        <inttypes.h>\n        <iso646.h>\n        <stdbool.h>\n        <stdint.h>\n        <tgmath.h>\n        <wchar.h>\n        <wctype.h>\n\n\nMissing additional 1999 Standard C standard header files...\n\n\nAvailable additional POSIX (IEEE Std 1003.1-2001) header files...\n        <aio.h>\n        <arpa/inet.h>\n        <cpio.h>\n        <dirent.h>\n        <dlfcn.h>\n        <fcntl.h>\n        <fmtmsg.h>\n        <fnmatch.h>\n        <ftw.h>\n        <glob.h>\n        <grp.h>\n        <iconv.h>\n        <langinfo.h>\n        <libgen.h>\n        <monetary.h>\n        <mqueue.h>\n        <ndbm.h>\n        <net/if.h>\n        <netdb.h>\n        <netinet/in.h>\n        <netinet/tcp.h>\n        <nl_types.h>\n        <poll.h>\n        <pthread.h>\n        <pwd.h>\n        <regex.h>\n        <sched.h>\n        <search.h>\n        <semaphore.h>\n        <strings.h>\n        <stropts.h>\n        <sys/ipc.h>\n        <sys/mman.h>\n        <sys/msg.h>\n        <sys/resource.h>\n        <sys/select.h>\n        <sys/sem.h>\n        <sys/shm.h>\n        <sys/socket.h>\n        <sys/stat.h>\n        <sys/statvfs.h>\n        <sys/time.h>\n        <sys/timeb.h>\n        <sys/times.h>\n        <sys/types.h>\n        <sys/uio.h>\n        <sys/un.h>\n        <sys/utsname.h>\n        <sys/wait.h>\n        <syslog.h>\n        <tar.h>\n        <termios.h>\n        <ucontext.h>\n        <ulimit.h>\n        <unistd.h>\n        <utime.h>\n        <utmpx.h>\n        <wordexp.h>\n\n\nMissing additional POSIX (IEEE Std 1003.1-2001) header files...\n        <spawn.h>\n        <trace.h>\n\n\nPointer sizes...\n        sizeof(char*)                   =    8\n        sizeof(void*)                   =    8\n        sizeof(void(*)(void))           =    8\n\n\nInteger sizes...\n        sizeof(char)                    =    1\n        sizeof(short)                   =    2\n        sizeof(int)                     =    4\n        sizeof(long)                    =    8\n        sizeof(long long)               =    8\n\n\nInteger-like sizes...\n        sizeof(clock_t)                 =    4\n        sizeof(div_t)                   =    8\n        sizeof(fpos_t)                  =    8\n        sizeof(intmax_t)                =    8\n        sizeof(ldiv_t)                  =   16\n        sizeof(off_t)                   =    8\n        sizeof(ptrdiff_t)               =    8\n        sizeof(sig_atomic_t)            =    4\n        sizeof(size_t)                  =    8\n        sizeof(time_t)                  =    8\n        sizeof(uintmax_t)               =    8\n        sizeof(wchar_t)                 =    4\n\n\nC++ 1998 integer-like sizes...\n\n\nC99 integer-like sizes...\n        sizeof(double_t)                =    8\n        sizeof(fenv_t)                  =    8\n        sizeof(fexcept_t)               =    4\n        sizeof(float_t)                 =    4\n        sizeof(int8_t)                  =    1\n        sizeof(int_fast16_t)            =    4\n        sizeof(int_fast32_t)            =    4\n        sizeof(int_fast64_t)            =    8\n        sizeof(int_fast8_t)             =    4\n        sizeof(int_least16_t)           =    2\n        sizeof(int_least32_t)           =    4\n        sizeof(int_least64_t)           =    8\n        sizeof(int_least8_t)            =    1\n        sizeof(intptr_t)                =    8\n        sizeof(ssize_t)                 =    8\n        sizeof(uint_fast16_t)           =    4\n        sizeof(uint_fast32_t)           =    4\n        sizeof(uint_fast64_t)           =    8\n        sizeof(uint_fast8_t)            =    4\n        sizeof(uint_least16_t)          =    2\n        sizeof(uint_least32_t)          =    4\n        sizeof(uint_least64_t)          =    8\n        sizeof(uint_least8_t)           =    1\n        sizeof(uintptr_t)               =    8\n        sizeof(wchar_t)                 =    4\n        sizeof(wctype_t)                =    4\n        sizeof(wint_t)                  =    4\n        sizeof(_Bool)                   =    1\n\n\nFloating-point sizes...\n        sizeof(float)                   =    4\n        sizeof(double)                  =    8\n        sizeof(long double)             =   16\n\n\nMissing data types...\n        imaxdiv_t\n        lldiv_t\n        mbstate_t\n        nothrow_t\n        wctrans_t\n        _Complex\n        _Imaginary\n\n\nfpathconf() and pathconf() tests...\n        pathconf(\"/\", _PC_NAME_MAX)              =   255\n        pathconf(\"/bin\", _PC_NAME_MAX)           =   255\n        pathconf(\"/etc\", _PC_NAME_MAX)           =   255\n        pathconf(\"/tmp\", _PC_NAME_MAX)           =   255\n        pathconf(\"/usr\", _PC_NAME_MAX)           =   255\n        pathconf(\"/var\", _PC_NAME_MAX)           =   255\n        pathconf(\"./\", _PC_NAME_MAX)             =   255\n        fpathconf(fileno(stdin),  _PC_NAME_MAX)  =    -1\n        fpathconf(fileno(stdout),  _PC_NAME_MAX) =    -1\n        fpathconf(fileno(stderr),  _PC_NAME_MAX) =    -1\n\n        pathconf(\"/\", _PC_PATH_MAX)              =  1023\n        pathconf(\"/bin\", _PC_PATH_MAX)           =  1023\n        pathconf(\"/etc\", _PC_PATH_MAX)           =  1023\n        pathconf(\"/tmp\", _PC_PATH_MAX)           =  1023\n        pathconf(\"/usr\", _PC_PATH_MAX)           =  1023\n        pathconf(\"/var\", _PC_PATH_MAX)           =  1023\n        pathconf(\"./\", _PC_PATH_MAX)             =  1023\n        fpathconf(fileno(stdin),  _PC_PATH_MAX)  =    -1\n        fpathconf(fileno(stdout),  _PC_PATH_MAX) =    -1\n        fpathconf(fileno(stderr),  _PC_PATH_MAX) =    -1\n\nfloat limits:\n        smallest floating-point number: 1.40129846e-45 == 2^(-149)      [IEEE 754 smallest 32-bit subnormal]\n        machine epsilon:                1.19209290e-07 == 2^(-23)       [IEEE 754 32-bit conformant]\n\ndouble limits:\n        smallest floating-point number: 4.94065646e-324 == 2^(-1074)    [IEEE 754 smallest 64-bit subnormal]\n        machine epsilon:                2.22044605e-16 == 2^(-52)       [IEEE 754 64-bit conformant]\n\nlong double limits:\n        smallest floating-point number: 0.00000000e+00 == 2^(-16494)    [IEEE 754 smallest 128-bit subnormal]\n        machine epsilon:                1.92592994e-34 == 2^(-112)      [IEEE 754 128-bit conformant]\n        long double appears to be 128-bit value stored in 128-bit (16-byte) field\n\n\nFEATURES TESTS COMPLETED\n\n========================================================================\nHP-UX 11.00/64 U  A500-7X/64 PA8700/750(2) pa-2.0  2048 Mb\nB3901BA.C-ANSI-C  B.11.11.10 HP C/ANSI C Compiler\n\nCompiler                             = cc\n\n\nAvailable standard predefined constant macros...\n        __bool_true_false_are_defined =        1\n        __DATE__                     = \"Feb 11 2008\"\n        __FILE__                     = \"features.c\"\n        __LINE__                     =      180\n        __STDC__                     =        1\n        __TIME__                     = \"09:01:55\"\n\n\nMissing standard predefined constant macros...\n        __cplusplus\n        __func__\n        __STDC_HOSTED__\n        __STDC_IEC_559__\n        __STDC_IEC_559_COMPLEX__\n        __STDC_ISO_10646__\n        __STDC_CONSTANT_MACROS\n        __STDC_FORMAT_MACROS\n        __STDC_LIMIT_MACROS\n        __STDC_VERSION__\n\n\nAvailable nonstandard but traditional header files...\n        <sys/types.h>\n        <varargs.h>\n\n\nMissing nonstandard but traditional header files...\n\n\nAvailable 1989 Standard C header files...\n        <assert.h>\n        <ctype.h>\n        <errno.h>\n        <float.h>\n        <limits.h>\n        <locale.h>\n        <math.h>\n        <setjmp.h>\n        <signal.h>\n        <stdarg.h>\n        <stddef.h>\n        <stdio.h>\n        <stdlib.h>\n        <string.h>\n        <time.h>\n\n\nMissing 1989 Standard C standard header files...\n\n\nAvailable additional 1999 Standard C header files...\n        <fenv.h>\n        <inttypes.h>\n        <stdbool.h>\n        <wchar.h>\n\n\nMissing additional 1999 Standard C standard header files...\n        <complex.h>\n        <iso646.h>\n        <stdint.h>\n        <tgmath.h>\n        <wctype.h>\n\n\nAvailable additional POSIX (IEEE Std 1003.1-2001) header files...\n        <aio.h>\n        <arpa/inet.h>\n        <cpio.h>\n        <dirent.h>\n        <dlfcn.h>\n        <fcntl.h>\n        <fmtmsg.h>\n        <fnmatch.h>\n        <ftw.h>\n        <glob.h>\n        <grp.h>\n        <iconv.h>\n        <langinfo.h>\n        <libgen.h>\n        <monetary.h>\n        <mqueue.h>\n        <ndbm.h>\n        <net/if.h>\n        <netdb.h>\n        <netinet/in.h>\n        <netinet/tcp.h>\n        <nl_types.h>\n        <poll.h>\n        <pthread.h>\n        <pwd.h>\n        <regex.h>\n        <sched.h>\n        <search.h>\n        <semaphore.h>\n        <strings.h>\n        <stropts.h>\n        <sys/ipc.h>\n        <sys/mman.h>\n        <sys/msg.h>\n        <sys/resource.h>\n        <sys/sem.h>\n        <sys/shm.h>\n        <sys/socket.h>\n        <sys/stat.h>\n        <sys/statvfs.h>\n        <sys/time.h>\n        <sys/timeb.h>\n        <sys/times.h>\n        <sys/types.h>\n        <sys/uio.h>\n        <sys/un.h>\n        <sys/utsname.h>\n        <sys/wait.h>\n        <syslog.h>\n        <tar.h>\n        <termios.h>\n        <ucontext.h>\n        <ulimit.h>\n        <unistd.h>\n        <utime.h>\n        <utmpx.h>\n        <wordexp.h>\n\n\nMissing additional POSIX (IEEE Std 1003.1-2001) header files...\n        <spawn.h>\n        <sys/select.h>\n        <trace.h>\n\n\nPointer sizes...\n        sizeof(char*)                   =    4\n        sizeof(void*)                   =    4\n        sizeof(void(*)(void))           =    4\n\n\nInteger sizes...\n        sizeof(char)                    =    1\n        sizeof(short)                   =    2\n        sizeof(int)                     =    4\n        sizeof(long)                    =    4\n        sizeof(long long)               =    8\n\n\nInteger-like sizes...\n        sizeof(clock_t)                 =    4\n        sizeof(div_t)                   =    8\n        sizeof(fpos_t)                  =    4\n        sizeof(intmax_t)                =    8\n        sizeof(ldiv_t)                  =    8\n        sizeof(off_t)                   =    4\n        sizeof(ptrdiff_t)               =    4\n        sizeof(sig_atomic_t)            =    4\n        sizeof(size_t)                  =    4\n        sizeof(time_t)                  =    4\n        sizeof(uintmax_t)               =    8\n        sizeof(wchar_t)                 =    4\n\n\nC++ 1998 integer-like sizes...\n\n\nC99 integer-like sizes...\n        sizeof(double_t)                =    8\n        sizeof(fenv_t)                  =    4\n        sizeof(fexcept_t)               =    4\n        sizeof(float_t)                 =    4\n        sizeof(int8_t)                  =    1\n        sizeof(int_fast16_t)            =    4\n        sizeof(int_fast32_t)            =    4\n        sizeof(int_fast64_t)            =    8\n        sizeof(int_fast8_t)             =    4\n        sizeof(int_least16_t)           =    2\n        sizeof(int_least32_t)           =    4\n        sizeof(int_least64_t)           =    8\n        sizeof(int_least8_t)            =    1\n        sizeof(intptr_t)                =    4\n        sizeof(ssize_t)                 =    4\n        sizeof(uint_fast16_t)           =    4\n        sizeof(uint_fast32_t)           =    4\n        sizeof(uint_fast64_t)           =    8\n        sizeof(uint_fast8_t)            =    4\n        sizeof(uint_least16_t)          =    2\n        sizeof(uint_least32_t)          =    4\n        sizeof(uint_least64_t)          =    8\n        sizeof(uint_least8_t)           =    1\n        sizeof(uintptr_t)               =    4\n        sizeof(wchar_t)                 =    4\n        sizeof(wctype_t)                =    4\n        sizeof(wint_t)                  =    4\n        sizeof(_Bool)                   =    1\n\n\nFloating-point sizes...\n        sizeof(float)                   =    4\n        sizeof(double)                  =    8\n        sizeof(long double)             =   16\n\n\nMissing data types...\n        imaxdiv_t\n        lldiv_t\n        mbstate_t\n        nothrow_t\n        wctrans_t\n        _Complex\n        _Imaginary\n\n\nfpathconf() and pathconf() tests...\n        pathconf(\"/\", _PC_NAME_MAX)              =   255\n        pathconf(\"/bin\", _PC_NAME_MAX)           =   255\n        pathconf(\"/etc\", _PC_NAME_MAX)           =   255\n        pathconf(\"/tmp\", _PC_NAME_MAX)           =   255\n        pathconf(\"/usr\", _PC_NAME_MAX)           =   255\n        pathconf(\"/var\", _PC_NAME_MAX)           =   255\n        pathconf(\"./\", _PC_NAME_MAX)             =   255\n        fpathconf(fileno(stdin),  _PC_NAME_MAX)  =    -1\n        fpathconf(fileno(stdout),  _PC_NAME_MAX) =    -1\n        fpathconf(fileno(stderr),  _PC_NAME_MAX) =    -1\n\n        pathconf(\"/\", _PC_PATH_MAX)              =  1023\n        pathconf(\"/bin\", _PC_PATH_MAX)           =  1023\n        pathconf(\"/etc\", _PC_PATH_MAX)           =  1023\n        pathconf(\"/tmp\", _PC_PATH_MAX)           =  1023\n        pathconf(\"/usr\", _PC_PATH_MAX)           =  1023\n        pathconf(\"/var\", _PC_PATH_MAX)           =  1023\n        pathconf(\"./\", _PC_PATH_MAX)             =  1023\n        fpathconf(fileno(stdin),  _PC_PATH_MAX)  =    -1\n        fpathconf(fileno(stdout),  _PC_PATH_MAX) =    -1\n        fpathconf(fileno(stderr),  _PC_PATH_MAX) =    -1\n\nfloat limits:\n        smallest floating-point number: 1.40129846e-45 == 2^(-149)      [IEEE 754 smallest 32-bit subnormal]\n        machine epsilon:                1.19209290e-07 == 2^(-23)       [IEEE 754 32-bit conformant]\n\ndouble limits:\n        smallest floating-point number: 4.94065646e-324 == 2^(-1074)    [IEEE 754 smallest 64-bit subnormal]\n        machine epsilon:                2.22044605e-16 == 2^(-52)       [IEEE 754 64-bit conformant]\n\nlong double limits:\n        smallest floating-point number: 0.00000000e+00 == 2^(-16494)    [IEEE 754 smallest 128-bit subnormal]\n        machine epsilon:                1.92592994e-34 == 2^(-112)      [IEEE 754 128-bit conformant]\n        long double appears to be 128-bit value stored in 128-bit (16-byte) field\n\n\nFEATURES TESTS COMPLETED\n\n\n-- \nH.Merijn Brand         Amsterdam Perl Mongers (http://amsterdam.pm.org/)\nusing & porting perl 5.6.2, 5.8.x, 5.10.x  on HP-UX 10.20, 11.00, 11.11,\n& 11.23, SuSE 10.1 & 10.2, AIX 5.2, and Cygwin.       http://qa.perl.org\nhttp://mirrors.develooper.com/hpux/            http://www.test-smoke.org\n                        http://www.goldmark.org/jeff/stupid-disclaimers/\n"},{"id":"68407","messageId":"alpine.LNX.1.00.0802111115360.13593@iabervon.org","threadId":"12026","inReplyTo":"20080211090326.2d0c64cd@pc09.procura.nl","subject":"Re: C-compiler features","fromName":"Daniel Barkalow","fromEmail":"barkalow@iabervon.org","sentAt":"2008-02-11T16:24:14Z","receivedAt":"2008-02-11T16:24:14Z","isPatch":false,"sender":{"key":"barkalow@iabervon.org","avatar":"https://avatars.githubusercontent.com/u/55364219?v=4"},"body":"On Mon, 11 Feb 2008, H.Merijn Brand wrote:\n\n> Having to answer questions about my C-compiler isn't always that easy.\n> Sometimes you need to find include files, for which you don't know if\n> and if how they are used. Sometimes you need to compile test programs\n> to see the behaviour, and then there is threads, 32/64 bitness etc.\n> \n> I was recently pointed to http://www.math.utah.edu/pub/features/\n> Which gives a nice summary of what your C/C++ compiler behaves like.\n> Here's the output for HP C-ANSI-C on HP-UX 11.23/64 IPF and on 11.00\n\nHmm. I'm actually more curious about what language features a compiler \nsupports (Is \"inline\" a keyword? Does it accept C99 comments? C99 struct \ninitializers? Flex arrays?). Sometimes the errors you get when these \naren't what the code expects are hard to identify, because the compiler \ncomes up with some odd interpretation of the structure as what you meant \nbut messed up, and you get a slew of inappropriate error messages, \nsometimes hiding the actual wrong thing. Missing header \nfiles/types/macros/declarations generally give a clear first error \nmessage.\n\n\t-Daniel\n*This .sig left intentionally blank*\n"}]}