Bug 72499 - LLONG_MAX is not in strict ansi c++98, but poppler uses it and builds with "-ansi"
Summary: LLONG_MAX is not in strict ansi c++98, but poppler uses it and builds with "-...
Alias: None
Product: poppler
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Hardware: Other FreeBSD
: medium normal
Assignee: poppler-bugs
QA Contact:
Depends on:
Reported: 2013-12-09 01:09 UTC by Allison Lortie (desrt)
Modified: 2014-01-14 19:28 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Description Allison Lortie (desrt) 2013-12-09 01:09:25 UTC
Bug summary says it all.  popper should probably back off of -ansi if it wants to use 'long long'.

This gets caught by clang on freebsd where -ansi results in __STRICT_ANSI__ being defined and __LONG_LONG_SUPPORTED is only defined if not strict, or if the C standard version is greater than c99.
Comment 1 Albert Astals Cid 2013-12-12 20:49:00 UTC
Does it work if you replace -ansi for -std=c++98 ?
Comment 2 Allison Lortie (desrt) 2013-12-13 17:33:28 UTC
No.  c++98 is the standard in which 'long long' does not exist.  -std=c++11 does work, however (but I suspect that this may make some older compilers unhappy).
Comment 3 Adrian Johnson 2013-12-13 22:53:12 UTC
We could either omit the -ansi option (which defaults to c++98 + gnu extensions) or use -std=c++11 when gcc >= 4.7.

If we omit the option we need to ensure we don't use gnu extensions that are not supported by visual c++. If we use -std=c++11 we need to ensure we don't start using c++11 features until they are widely supported by compilers that are a few years old.
Comment 4 Allison Lortie (desrt) 2013-12-14 02:29:37 UTC
I leave it up to you... I think the easiest thing would be to just drop it and try to exercise caution...
Comment 5 Albert Astals Cid 2013-12-15 22:05:44 UTC
And there's no flag to tell clang "yeah we know, we want to be standard but we also want to use long long since it's kind of interesting". This seems one of those cases where clang is trying to be too smart for its own good imho.
Comment 6 Allison Lortie (desrt) 2013-12-15 23:16:54 UTC
I'm sort of confused by that logic... you're using a compiler flag to enforce strict c++98 compliance so that you can't accidentally use non-standard features, but you get upset when the compiler forces you to adhere to the standard.

If you want to be able to use features outside of the spec, then drop the flag that says "I want to be held to the spec".

fwiw, it should be possible to work around this issue on FreeBSD by -D__LONG_LONG_SUPPORTED.
Comment 7 Albert Astals Cid 2014-01-14 19:28:24 UTC
I've removed -ansi in the master branch

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.