• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
#include - Bug or weird part of the C[++] spec?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

#include - Bug or weird part of the C[++] spec?


  • Subject: #include - Bug or weird part of the C[++] spec?
  • From: Matt Gough <email@hidden>
  • Date: Tue, 1 Jul 2008 09:46:58 +0200

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 <stdio.h>>>>
	#include <stdio.h>, <math.h> 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


  • Follow-Ups:
    • Re: #include - Bug or weird part of the C[++] spec?
      • From: Matt Gough <email@hidden>
  • Next by Date: Re: #include - Bug or weird part of the C[++] spec?
  • Next by thread: Re: #include - Bug or weird part of the C[++] spec?
  • Index(es):
    • Date
    • Thread