[xsd-users] Compile error on generated code with CXXFLAGS = -pedantic

Jeroen N. Witmond jnw at xs4all.nl
Sat Jan 13 08:42:47 EST 2007


Hi Boris,

Boris Kolpackov <boris at codesynthesis.com> writes:

> Jeroen N. Witmond <jnw at xs4all.nl> writes:
>
>> I like to compile all my c++ sources with g++ option -pedantic (together
>> with -W -Wall). When used on generated code, this results in "error: ISO
>> C++ does not support 'long long'" on these lines:
>
> They should have called this option -anal ;-) for pretty much every
> C++ compiler supports long long.
>
>
>> I know I can hack around it by deleting these lines from the output of
>> `xsd cxx-tree --generate-xml-schema schema.xsd` and using that
>> everywhere
>> else, but is there a better way to get around this?
>
> No need to hack those lines: you can always provide custom definitions
> for the types you don't like as described in the C++/Tree Mapping
> Customization Guide[1]:
>
> xsd cxx-tree --generate-xml-schema --custom-type long=64bit_t schema.xsd
>
> Where 64bit_t is a 64-bit signed integer type of your choice.

Just for the record and the mailing list archives: I find that I need
  --custom-type long=int64_t --custom-type unsignedLong=uint64_t
  --custom-type integer=int64_t
to get -pedantic to be quiet.  Types int64_t and uint64_t appear to be a
part of the C99 standard; at least on my Debian etch box, the code
generated with these options compiles automagically.

Jeroen.





More information about the xsd-users mailing list