IBM Support

LI74310: PREPROCESSOR ERROR

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • With the following test case, the preprocessor does not
    pre-precoess the file correctly when it is treated as a C++ test
    case. It works fine for when treated as a C test case.
    
    
    Compile Line:
    
    
    =======Start of tc.c================
    int main()
    {
    #if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \
          && ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' ==
    40) \
          && (')' == 41) && ('*' == 42) && ('+' == 43) && (',' ==
    44) \
          && ('-' == 45) && ('.' == 46) && ('/' == 47) && ('0' ==
    48) \
          && ('1' == 49) && ('2' == 50) && ('3' == 51) && ('4' ==
    52) \
          && ('5' == 53) && ('6' == 54) && ('7' == 55) && ('8' ==
    56) \
          && ('9' == 57) && (':' == 58) && (';' == 59) && ('<' ==
    60) \
          && ('=' == 61) && ('>' == 62) && ('?' == 63) && ('A' ==
    65) \
          && ('B' == 66) && ('C' == 67) && ('D' == 68) && ('E' ==
    69) \
          && ('F' == 70) && ('G' == 71) && ('H' == 72) && ('I' ==
    73) \
          && ('J' == 74) && ('K' == 75) && ('L' == 76) && ('M' ==
    77) \
          && ('N' == 78) && ('O' == 79) && ('P' == 80) && ('Q' ==
    81) \
          && ('R' == 82) && ('S' == 83) && ('T' == 84) && ('U' ==
    85) \
          && ('V' == 86) && ('W' == 87) && ('X' == 88) && ('Y' ==
    89) \
          && ('Z' == 90) && ('[' == 91) && ('\\' == 92) && (']' ==
    93) \
          && ('^' == 94) && ('_' == 95) && ('a' == 97) && ('b' ==
    98) \
          && ('c' == 99) && ('d' == 100) && ('e' == 101) && ('f' ==
    102) \
          && ('g' == 103) && ('h' == 104) && ('i' == 105) && ('j' ==
    106) \
          && ('k' == 107) && ('l' == 108) && ('m' == 109) && ('n' ==
    110) \
          && ('o' == 111) && ('p' == 112) && ('q' == 113) && ('r' ==
    114) \
          && ('s' == 115) && ('t' == 116) && ('u' == 117) && ('v' ==
    118) \
          && ('w' == 119) && ('x' == 120) && ('y' == 121) && ('z' ==
    122) \
          && ('{' == 123) && ('|' == 124) && ('}' == 125) && ('~' ==
    126))
    #error "The character set is not based on ISO-646."
    printf("The character set is not based on ISO-646!\n");
    #endif
      return 0;
    }
    ==================End of tc.c=======================
    
    
    Preprocessing the source as C yields the expected results:
    $ xlC_r tc.c -E
    #line 1 "tc.c"
    int main()
    {
    #line 29
      return 0;
    }
    
    However, preprocessing the source as C++ yields conflicting
    results:
    $ xlC_r -+ tc.c -E
    #line 1 "tc.c"
    int main()
    {
    #line 27
    printf("The character set is not based on ISO-646!\n");
    
      return 0;
    }
    "tc.c", line 26.2: 1540-0859 (S) #error directive: "The
    character set is
    not based on ISO-646.".
    

Local fix

  • n/a
    

Problem summary

  • C++ programmers who use the compiler in
    preprocess-only mode may encounter this issue.
    
    The lexer fails to recognize escape
    sequences in preprocessor directives (#if, #elif), in
    preprocess-only mode.
    

Problem conclusion

  • We process escape sequences at all times, if
    they are inside preprocessor directives.
    

Temporary fix

Comments

APAR Information

  • APAR number

    LI74310

  • Reported component name

    XL C/C++ SLES10

  • Reported component ID

    5724U8300

  • Reported release

    A10

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt

  • Submitted date

    2009-03-30

  • Closed date

    2009-03-30

  • Last modified date

    2009-03-30

  • APAR is sysrouted FROM one or more of the following:

    IZ33740

  • APAR is sysrouted TO one or more of the following:

    LI74401

Fix information

  • Fixed component name

    XL C/C++ SLES10

  • Fixed component ID

    5724U8300

Applicable component levels

[{"Business Unit":{"code":"BU054","label":"Systems w\/TPS"},"Product":{"code":"SSJT9L","label":"XL C\/C++"},"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"A.1","Line of Business":{"code":"LOB08","label":"Cognitive Systems"}}]

Document Information

Modified date:
16 October 2021