Re: preprocessor symbol map incorrect

Eric Ludlam <[email protected]> Mon, 09 Feb 2015 21:10:56 -0500
Newsgroups gmane.emacs.semantic
Message-ID <[email protected]>
On 02/04/2015 01:35 PM, RJD wrote:
> I have this in my .emacs file:
>
> =====.emacs=====
> (semantic-c-add-preprocessor-symbol "UNIT_TESTS" "")
> (semantic-c-add-preprocessor-symbol "SW_VERSION" "22"))
> =====END .emacs=
>
> This means semantic should be able to parse code that is within:
>
> #if ( SW_VERSION >= 22 )
> void someFunction( void ) { }
> #endif /* ( SW_VERSION >= 22 ) */
>
> and
>
> #if defined( UNIT_TESTS )
> void someOtherFunction( void ) { }
> #endif /* defined( UNIT_TESTS ) */
>
> And this works fine. However, in the case where I have a more complex check:
>
> #if ( SW_VERSION >= 22 ) && ( defined( UNIT_TESTS ) )
> void someOtherOtherFunc( void ) { }
> #endif /* ( SW_VERSION >= 22 ) && ( defined( UNIT_TESTS ) ) */
>
> This does not work.

There is a bug in hideif that broke #if parsing in semantic for some 
versions of Emacs.  I think it is 24.4 and later?

You may just be out of luck for a little while, or you could use emacs 
24.3 which is what I have default w/ ubuntu, and which worked fine for 
your example.

I also tried this in emacs 25, and none of the expressions worked.

Eric

------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/