0

The python C-parser pycparser fails at the following #pragma directive:

#pragma ghs section somestring="some_other_string"

generates error:

AssertionError: invalid #pragma directive

What's wrong with this #pragma?

michal.szulc
  • 71
  • 1
  • 4

1 Answers1

0

Most likely nothing. The syntax, meaning and compiler behaviour of #pragma lines are implementation-defined. From n3797 S16.6:

A preprocessing directive of the form

# pragma pp-tokens(opt) new-line

causes the implementation to behave in an implementation-defined manner. The behavior might cause translation to fail or cause the translator or the resulting program to behave in a non-conforming manner. Any pragma that is not recognized by the implementation is ignored.

The C standard has similar language.

If you want PyParser to do something other than throw an assertion error, you need to see what options are available to change its behaviour. Sorry, but that's beyond my scope.

david.pfx
  • 10,520
  • 3
  • 30
  • 63