RE: #include - Bug or weird part of the C[++] spec?
RE: #include - Bug or weird part of the C[++] spec?
- Subject: RE: #include - Bug or weird part of the C[++] spec?
- From: Luca Ciciriello <email@hidden>
- Date: Tue, 1 Jul 2008 09:20:50 +0100
- Importance: Normal
Hi.
Try to see the C++ standard document ISO\IEC 14882 (2006 draft i.e.) chapter 16 par 1.
Could be something interesting there about the C++ preprocessor syntax.
Luca
----------------------------------------
> From: email@hidden
> To: email@hidden
> Date: Tue, 1 Jul 2008 09:58:49 +0200
> Subject: Re: #include - Bug or weird part of the C[++] spec?
>
> Actually, it does seem like a bug:
>
> http://gcc.gnu.org/onlinedocs/cpp/Include-Syntax.html#Include-Syntax
>
> "It is an error if there is anything (other than comments) on the line
> after the file name."
>
> Matt
> On 1 Jul 2008, at 9:46am, email@hidden wrote:
>
>> I noticed recently, when viewing a source file, that all the text
>> was being syntax colored as if it were part of a string literal.
>>
>> However the code compiled and ran correctly.
>>
>> On further investigation, it turned out that there was an extra " at
>> the end of a #include. i.e:
>>
>>
>> #include "MyHeader.h""
>>
>> Further investigation showed that pretty much any text can appear
>> after the included file without causing a compile error or warning
>> (with all warnings ON).
>>
>> i.e all these full lines are perfectly 'valid':
>>
>> #include "MyHeader.h"1234 * 67
>> #include >>>
>> #include , But it won't really include math.h
>>
>> #include "MyHeader.h" */ Does not need an opening comment (But will
>> close one if it existed!)
>>
>> So is this really a bug, or some part of the spec that I have
>> happily ignored until now.
>>
>> If it is in the spec, then there should be some warning for it I
>> think.
>>
>> Matt Gough
>> _______________________________________________
>> Do not post admin requests to the list. They will be ignored.
>> Xcode-users mailing list (email@hidden)
>> Help/Unsubscribe/Update your Subscription:
>>
>> This email sent to email@hidden
>
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Xcode-users mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
_________________________________________________________________
http://clk.atdmt.com/UKM/go/msnnkmgl0010000009ukm/direct/01/ _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden