Red Hat Bugzilla – Bug 115354
Flex++ using namespace std causes problems.
Last modified: 2015-05-04 21:32:04 EDT
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
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.
You will get a compiler error that the function call is ambigious.
It trys the global function and any standard function equivilents.
Compiler should use the global
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
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.
Fedora Core 1 is not supported any longer, however the fix was pushed for FC4.