Announcement

Collapse
No announcement yet.

ambiguity in c99

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • ambiguity in c99

    cpp doesn't like this very much:

    Code:
    foo_p.h:
    
    #ifdef FOO
    Code:
    foo.h:
    
    #include "foo_p.h"
    #error
    #include "foo_e.h"
    Code:
    foo_e.h:
    
    #endif
    I read through the 2007 revision of the C99 standard and it doesn't comment on this usage, but a natural reading would imply that it should be correct. However, cpp, even with -std="c99", does not approve.

    Does anyone have a definite answer whether this is/is not correct?

    edit: I'm aware that wanting to do something like this makes me a bad person. I don't care.

  • #2
    It's my understanding that the #if/#endif scope was file-specific for the preprocessor.

    It might not be specifically mentioned, but it was probably too obvious to mention.
    "The issue is there are still many people out there that use religion as a crutch for bigotry and hate. Like Ben."
    Ben Kenobi: "That means I'm doing something right. "

    Comment


    • #3

      Comment


      • #4
        The C/C++ Standards, at least circa 2004, were wonderfully ambiguous in many areas.
        "The issue is there are still many people out there that use religion as a crutch for bigotry and hate. Like Ben."
        Ben Kenobi: "That means I'm doing something right. "

        Comment


        • #5
          Are you calling PH a foo?
          Speaking of Erith:

          "It's not twinned with anywhere, but it does have a suicide pact with Dagenham" - Linda Smith

          Comment


          • #6
            Tech foorum....

            ACK!
            Don't try to confuse the issue with half-truths and gorilla dust!

            Comment

            Working...
            X