Re: semantic-c-add-preprocessor-symbol #error

Eric Ludlam <[email protected]> Mon, 26 Jan 2015 22:34:16 -0500
Newsgroups gmane.emacs.semantic
Message-ID <[email protected]>
On 01/21/2015 07:39 AM, RJD wrote:
> Hi,
>
> I do not use EDE mode at work for a few reasons. Instead, I have hooks in my
> .emacs that deal with files in a certain directory. Anyway, we have multiple
> versions of software so there is code that is preprocessed out depending on
> the version.
>
> By default I elect to work in a certain version because that is generally
> the version we work on.
>
> So, in my emacs file:
>
> (semantic-c-add-preprocessor-symbol "SW_VERSION" "22")
>
> Here, I want semantic to know about code that is version 22. eg:
>
> #if ( SW_VERSION >= 22 )
> void some22Function( void )
> {
>    // ...
> }
> #endif /* ( SW_VERSION >= 22 ) */
>
> And this works fine. However, if I move the cursor to some empty location in
> the source file then the following error emerges in the minibar:
>
> Macro: SW_VERSION #error in summary fcn

Fortunately the error is only when trying to create a string to show in 
the minibuffer.

I checked in a small change that should solve this problem though.

Thanks detailed bug report.
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/