Red Hat Bugzilla – Bug 78535
Source: -ansi used on ANSI C++ incompatible code
Last modified: 2008-05-01 11:38:04 EDT
Compiling redhat-artwork on my system with Intel compiler I received such
checking for Qt... configure: error: Qt (>= Qt 3.0.3) (library qt-mt) not
found. Please check your installation!
For more details about this problem, look at the end of config.log.
Make sure that you have compiled Qt with thread support!
error: Bad exit status from /home/users/compiler/tc_5/WORK_DIR/tmp/rpm-
But I have Qt3 installed so I began investigating.
Looking to config.log I realized that configure tried to compile test case
which uses Qt with '-ansi -pedantic' options. But this is incorrect! Qt library
uses STL library and gcc3.2 STL library contain GNU extensions:
see /usr/include/c++/3.2/bits/stl_alloc.h(928) (where actually error is emitted
with -ansi) and comment above:
// Inhibit implicit instantiations for required instantiations,
// which are defined via explicit instantiations elsewhere.
// NB: This syntax is a GNU extension.
This syntax (I mean 'extern template') isn't described in ANSI C++ specification
(see paragraph 14.7.2 - Explicit instantiation) and therefore isn't allowed
when -ansi specified in compiler command line.
GNU compiler doesn't STRICT ANSI check so code passes succesfully, but strict
compiler will emit error. To increase Red Hat Linux portability you shouldn't
use '-ansi -pedantic' with STL and hence Qt.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. I'm afraid you won't be able to reproduce bug because you haven't compiler I
Actual Results: Compilation error.
Expected Results: Succesfully built package.
I'll attach the patch which removes '-ansi' from command line
Created attachment 86285 [details]
Patch which removes -ansi -pedantic from command line
-ansi is only used "if test "$GCC" = "yes""
-ansi would be pretty useless if you couldn't use it together with
If you are convincing configure that gcc is used, you need to use a