Bug 115354 - Flex++ using namespace std causes problems.
Summary: Flex++ using namespace std causes problems.
Alias: None
Product: Fedora
Classification: Fedora
Component: flex
Version: 1
Hardware: i386
OS: Linux
Target Milestone: ---
Assignee: Petr Machata
QA Contact:
Depends On:
TreeView+ depends on / blocked
Reported: 2004-02-11 05:31 UTC by Damion Hancock
Modified: 2015-05-05 01:32 UTC (History)
1 user (show)

Clone Of:
Last Closed: 2006-01-18 16:32:29 UTC

Attachments (Terms of Use)

Description Damion Hancock 2004-02-11 05:31:56 UTC
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.
 fabs(int) could be ::fabs(float),std::fabs(double) or std::fabs(long

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 17:14:46 UTC
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 16:32:29 UTC
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.