Re: [patch] misc cosmetic trivia and a question
Stefan Seefeld <[email protected]> Mon, 07 May 2007 10:18:02 -0400
| Newsgroups | gmane.comp.documentation.synopsis |
|---|---|
| Message-ID | <[email protected]> |
Bernhard Fischer wrote:
> Hi,
>
> Attached some misc trivial fallouts.
>
> today Bernhard <..>
> * Cpp/ParserImpl.cc (parse): Document a bit and try to remove
> even predefined macros.
> * Python/Object.hh (narrow): Add question.
> * Lexer.cc (process_directive): Raise a runtime-error as
> suggested in a comment.
> * SymbolTable/Scope.cc: include typeinfo needed for typeid.
> * Lexer.hh (is_letter, is_hexdigit): Silence warning about
> missing parenthesis.
>
>
> Re: Cpp/ParserImpl.cc: consider echo '#include <features.h>' > i.c
> $ synopsis -p C -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -o /dev/null i.c
> /usr/include/features.h(155): warning: #undef may not be used on this
> predefined name: _LARGEFILE64_SOURCE
> Traceback (most recent call last):
> File "/opt/synopsis-trunk/bin/synopsis", line 224, in ?
> main()
> File "/opt/synopsis-trunk/bin/synopsis", line 219, in main
> processor.process(AST.AST())
> File
> "/opt/synopsis-trunk/lib/python2.4/site-packages/Synopsis/Processor.py",
> line 160, in process
> return self.processors[0].process(ast, **my_kwds)
> File
> "/opt/synopsis-trunk/lib/python2.4/site-packages/Synopsis/Parsers/C/Parser.py",
> line 58, in process
> profile = self.profile)
> File
> "/opt/synopsis-trunk/lib/python2.4/site-packages/Synopsis/Parsers/Cpp/__init__.py",
> line 42, in process
> self.verbose, self.debug, self.profile)
> TypeError: __init__() takes exactly 2 arguments (1 given)
That one is fixed now. (An error in the error handling code, *sigh* )
> (getting some meaningful backtrace out of this error is another problem
> that is not of interrest for now).
Well, the error came from C++ code.
> I think that specifying remove_macro_definition(mymacro,true) should not
> raise this warning. The default (false, don't remove even predefined
> macros) sounds like the warning is in order. Thoughts?
The warning caused by the above use stems from the fact that, right now,
any macro coming from both the emulator as well as user-provided -D options
are considered 'predefined', and thus non-undefinable.
We may loosen that a bit by either define none of them as 'predefined'
(with that meaning), or only make the ones from the emulator predefined.
I'm not sure what would be considered 'correct' in this context. May be
Hartmut can give some input ?
Regards,
Stefan
PS: will look into the patches separately, thanks.
--
...ich hab' noch einen Koffer in Berlin...