Bug 78412 - Source: -ansi used on ANSI C++ incompatible code
Summary: Source: -ansi used on ANSI C++ incompatible code
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: switchdesk
Version: 8.0
Hardware: i686
OS: Linux
Target Milestone: ---
Assignee: Mike A. Harris
QA Contact: Jay Turner
Depends On:
TreeView+ depends on / blocked
Reported: 2002-11-22 16:01 UTC by Sysoltsev Slawa
Modified: 2015-01-08 00:01 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2002-11-22 16:02:00 UTC

Attachments (Terms of Use)
Ok, here is the patch, which removes '-ansi' from command line. (976 bytes, patch)
2002-11-25 09:50 UTC, Sysoltsev Slawa
no flags Details | Diff

Description Sysoltsev Slawa 2002-11-22 16:01:54 UTC
From Bugzilla Helper:
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)

Description of problem:
Compiling switchdesk on my system with Intel compiler I received such message 
during build:

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-tmp.3686 

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):

How reproducible:

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.

Additional info:

Comment 1 Mike A. Harris 2002-11-24 03:23:52 UTC
We do not support compilers other than what we ship.  Feel free to attach
a patch which resolves the problem for you however and it can be considered
for inclusion in the future perhaps.

Comment 2 Sysoltsev Slawa 2002-11-25 09:50:21 UTC
Created attachment 86284 [details]
Ok, here is the patch, which removes '-ansi' from command line.

Note You need to log in before you can comment on or make changes to this bug.