Re: Preprocessor directives ?
Date: Sat, 31 Jan 2004 23:47:21 GMT
Pierre Asselin wrote:
> Richard Edgar <firstname.lastname@example.org> wrote:
>> Steve Lionel wrote:
>>> Lastly, I'll note that use of such directives will make your code
>>> non-portable, though the extent of the non-portability depends on
>>> exactly what you end up using.
>> Minor nitpick.... it needn't. I've used a code which did some makefile
>> magic - run cpp on the source code, and feed the result to the compiler.
> Minor nitpic squared, the C preprocessor operates on C-language
> tokens, not characters. Not all legal Fortran constructs are made
> up of legal C tokens, so the preprocessor may choke! But this is
> unusual. Just another little thing to watch for.
In particular, be very careful of character concatenation (//) on
versions of the C preprocessor that have been extended to understand
C++ syntax. In C++, the slash-slash is a comment marker.
- Re: Preprocessor directives ?
... > magic - run cpp on the source code, and feed the result to the compiler. ... the C preprocessor operates on C-language ... tokens, not characters. ... Not all legal Fortran constructs are made ...
- Re: The C++ Preprocessor [Re: Boost Workshop at OOPSLA 2004]
... > ability to process tokens individually, regardless of the type of preprocessing ... implementing simple domain-specific languages. ... With a C99 preprocessor, and typeof/decltype it could be greatly ...
- Re: Paul Grahams teaching style is bad
... > operates on the abstract syntax tree produced by parsing the source ... > tokens) with some other tokens. ... You could in theory make a C preprocessor do anything that can ... Lisp's macro facility is out of the box able to easily ...
- Re: preprocessor tokenization whitespace?
... The C standard does not define the output of the preprocessor as a text ... sequence of tokens and white-space. ... > comment is replaced by one space character. ... > I see nothing in the discussion of macro replacement that would lead to ...
- Re: A variation of #
... Is there a method of charifying constants defined on the preprocessor ... concatenated with the ' tokens. ... If you can convince the relevant person to define the relevant constants ... as character constants, that would make things a lot easier. ...