This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: preprocessing directive with no new-line character
- From: Mathieu Malaterre <mathieu dot malaterre at gmail dot com>
- To: gcc-help <gcc-help at gcc dot gnu dot org>
- Date: Mon, 17 Jul 2017 16:09:42 +0200
- Subject: Re: preprocessing directive with no new-line character
- Authentication-results: sourceware.org; auth=none
- References: <20170717131958.GA23989@zira.vinc17.org>
On Mon, Jul 17, 2017 at 3:19 PM, Vincent Lefevre <vincent+gcc@vinc17.org> wrote:
> 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?
Do you have 0x0A at the end of your text file ?
--
Mathieu