[Ffmpeg-devel] Revised os2.diff

Dave Dodge dododge
Thu May 5 09:50:47 CEST 2005


On Sun, May 01, 2005 at 06:26:41PM +0300, Matti Hamalainen wrote:
> On Sun, 1 May 2005, Fred Rothganger wrote:
> >    I use spaces before the # regularly with impunity.  Compiles ok
> > under bothe gcc and msvc.  However, if you want spaces, I think
> > the style of putting them after the # is nicer.
> 
> Some preprocessors (GNU cpp too, in traditional mode) actually _require_ 
> that the preprocessor directive  starts from the first column of line 
> (whitespaces are allowed after '#' though). I don't know if this has any 
> relevance to FFMPEG project, but I  think it's a widely used practice to 
> do the right way(tm).

> http://tigcc.ticalc.org/doc/cpp.html

That document says (in the preprocessing lanuage section) that "white
space is allowed before and after the #".

> http://aragorn.uio.no/nanvaent/manpages/concepts/preprocessor.html

That one says that the '#' has to be in the first column.  It may be
specific to the LPC preprocessor implementation, though.

> I couldn't find any references to C standards though,

The C99 draft allows whitespace both before and after the #.  There is
a constraint that the only whitespace characters allowed after the #
are spaces and horizontal tabs.  Before the # you can have anything
that counts as whitespace, including things like form feeds and vtabs.

That said, I'd recommend putting the # in the first column anyway just
to be safe.  It might also benefit syntax highlighters or other code
processors that aren't as robust as a compiler might be.

                                                  -Dave Dodge





More information about the ffmpeg-devel mailing list