Menu

#3159 warning: missing terminating ' character from preprocessor

closed-fixed
Felix
sdcpp (4)
Preprocessor
5
2023-02-09
2020-12-04
No

E.g. for the following code

int i = 1'000;

We get a "warning: missing terminating ' character" from the preprocessor. Apparently this always happens when the number of ' in a line is odd. Apparently the preprocessor lexer in libcpp/lex.c tries to lex part of the number as a character literal.

The fix would probably be to implement handling of digit separators in preprocessor number lexing. I don't know if that is worth it, though. Maybe we instead want to go for a new preprocessor (e.g. one derived from current GCC or LLVM) that already supports digit separators (and other newer C features).

Related

Bugs: #3108
Wiki: SDCC-STD-UX

Discussion

  • Philipp Klaus Krause

    • Category: other --> Preprocessor
     
  • Philipp Klaus Krause

    The preprocessor in GCC 12.1 has support for digit separators, so by rebasing our fork on that one, this issues can be fixed.

     
  • Felix

    Felix - 2023-02-09
    • labels: --> sdcpp
    • status: open --> closed-fixed
    • assigned_to: Felix
     
  • Felix

    Felix - 2023-02-09

    The preprocessor has been updated to cpp from gcc 12.1.0. [r13690], fixing this issue as suggested.

     

    Related

    Commit: [r13690]


Log in to post a comment.

MongoDB Logo MongoDB