Bug 115354 - Flex++ using namespace std causes problems.
Flex++ using namespace std causes problems.
Status: CLOSED NEXTRELEASE
Product: Fedora
Classification: Fedora
Component: flex (Show other bugs)
1
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Petr Machata
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2004-02-11 00:31 EST by Damion Hancock
Modified: 2015-05-04 21:32 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2006-01-18 11:32:29 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Damion Hancock 2004-02-11 00:31:56 EST
Description of problem:
I noticed the flex-2.5.4a-gcc31.patch adds the line "using namespace
std" at the top of the skeleton file.  This causes a ambiguity if the
*.l file includes syntax that uses a function that could be global or
in the std namespace.
Example:
 fabs(int) could be ::fabs(float),std::fabs(double) or std::fabs(long
double)

Version-Release number of selected component (if applicable):
2.5.4a in Redhat 8.0 and up

How reproducible:
Use any standard function that also had a global counterpart.

Steps to Reproduce:
1. Create a *.l file with a global function that has a standard
equivilent, but leave the arguments ambiguous.
2. Compile a *.C from the *.l file with flex++
3. Try to compile the *.C file.
  
Actual results:
  You will get a compiler error that the function call is ambigious.
It trys the global function and any standard function equivilents. 

Expected results:
   Compiler should use the global 


Additional info:
   The *.l file can be written to be explicit about the function to
use, but it would be better if the flex.skel file didn't use the std
namespace over the whole file.  It would even affect header brought in
the *.l file. The istream calls in flex.skel should be scoped with
std:: instead.
Comment 1 Fedora Update System 2006-01-13 12:14:46 EST
From User-Agent: XML-RPC

flex-2.5.4a-35.fc4 has been pushed for FC4, which should resolve this issue.  If these problems are still present in this version, then please make note of it in this bug report.
Comment 2 Petr Machata 2006-01-18 11:32:29 EST
Fedora Core 1 is not supported any longer, however the fix was pushed for FC4.

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