This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
preprocessing directive with no new-line character
- From: Vincent Lefevre <vincent+gcc at vinc17 dot org>
- To: gcc-help at gcc dot gnu dot org
- Date: Mon, 17 Jul 2017 15:19:58 +0200
- Subject: preprocessing directive with no new-line character
- Authentication-results: sourceware.org; auth=none
According to the C standard (either C99 or C11), a preprocessing
directive ends with a new-line character: "The last token in the
sequence is the first new-line character that follows the first
token in the sequence."
But GCC accepts the following program with -std=c99 -pedantic:
int main (void)
{
return 0;
}
#define FOO
where there is no new-line character after "FOO".
Is there any reason?
--
Vincent Lefèvre <vincent@vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)