Thread: Verifying absence of brackets and parentheses

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Ticked and off
    Join Date
    Oct 2011
    Location
    La-la land
    Posts
    1,728
    Quote Originally Posted by thames View Post
    Has the program to be ansi compliant to be portable?
    All the environments I personally care about have C99 support. In fact, I'm more concerned with C++98/C++08/C++11 compatibility nowadays.

    ANSI C refers to ANSI X3.159-1989, also known as C89, also known as ISO/IEC 9899:1990, also known as C90. (Yes, C89 and C90 are the exact same version.)

    C99 provides "static inline" with the exact same semantics as it is used in C++, and flexible array members (final member in a structure with length determined at compile time). I consider these features essential for C programming. I often use the __thread keyword (GNU extension for thread-local storage, _Thread_local in C11) and compiler-provided atomic and vector built-ins (provided by GCC, ICC, and Pathscale compilers at least).

    Microsoft is the only vendor whose C compiler does not support C99, to my knowledge. I stopped using their products seven years ago, so I wouldn't really know for sure, though. However, their compiler is, I understand, a combined C/C++ compiler, which means it is likely to support at least static inline (since it is C++).

    (Then there are also some ancient environments; you might one day need to program an existing factory robot or something, that only has an ANSI C compiler available.)

    So, the answer depends entirely on the gamut of systems you consider. I limit myself to sane POSIX systems, so to me, the code is perfectly portable. Windows programmers might disagree.

    Quote Originally Posted by thames View Post
    if yes, does inline make the program unportable?
    As it is just an optimization feature, more used to indicate programmer intent than anything else, you can always drop it, and make the code plain C89.

  2. #2
    Tears of the stars thames's Avatar
    Join Date
    Oct 2012
    Location
    Rio, Brazil
    Posts
    193
    Quote Originally Posted by Nominal Animal View Post
    Windows programmers might disagree. As it is just an optimization feature, more used to indicate programmer intent than anything else, you can always drop it, and make the code plain C89.
    -_- I prefer to stick to C99.

    Edit: I didn't know ANSI refers to C89.
    Last edited by thames; 11-04-2012 at 10:44 AM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. dsa signing and verifying
    By kakashi316 in forum C Programming
    Replies: 4
    Last Post: 05-06-2012, 02:21 PM
  2. Need help with a Sudoku verifying program
    By Skeeter in forum C Programming
    Replies: 3
    Last Post: 10-30-2009, 08:15 PM
  3. verifying image compression
    By elninio in forum C++ Programming
    Replies: 2
    Last Post: 06-17-2008, 07:36 PM
  4. Verifying int with while(!(cin >> num))
    By motarded in forum C++ Programming
    Replies: 3
    Last Post: 02-26-2006, 10:37 PM
  5. Verifying single digit input
    By Syked4 in forum C Programming
    Replies: 8
    Last Post: 05-31-2005, 07:11 PM

Tags for this Thread