I noticed some peculiar behavior recompiling old code that I had turned in for 
a class.   If you note the screen shots in the attached folders Take_Home_1 and 
Take_Home_2, both programs compiled just fine with g++ 4.2 in Hardy, 32 bit. 
(Both are first level subdirectories of Midterm_mStephens)

Using Jaunty 64 bit Beta, g++ 4.3 from here on out.

When I try to compile TakeHome_1.cpp in it's own folder, I get the
following error:

TakeHome_1.cpp: In function ‘int main()’:
TakeHome_1.cpp:24: error: ‘system’ was not declared in this scope
line 24 reads:  
system("reset");

Now, TakeHome_2.cpp compiled in its own folder just fine, and it has the same 
line, in about the same place.
It ran just like my screen shot shows.

So I moved the two files side-by-side into the TakeHome_2 folder, to see what 
the difference was.
The only difference is that TakeHome_2.cpp has the line:
#include<algorithm>

So, just to see what would happen, I included <algorithm> in TakeHome_1.cpp and 
compiled.
TakeHome_1.cpp compiled just fine into a binary and ran like a top.
I have no idea why #include<algorithm> should have this affect.

The binary, TakeHome_1, was never in the directory, TakeHome_2, previous
to making this bug report.

I attached my homework with screen shots to show that it all did indeed
compile in g++ 4.2, using Hardy.

The information in this bug was obtained by dropping a copy of my
Midterm_mStephens folder into my home directory.

You should be able to reproduce this by repeating this, and compiling
the relevant pieces of code.

The results of the last year's test are used as a study guide for the next 
year's version.  My instructor can be reached at:
[email protected]   There should be no problem with posting this, except 
that it might not be the most elegant code posted on this site. 

I did not check any code of mine to see how it compiled.  You are
welcome to compile it for testing purposes.   All should have screen
shots of the program running properly in g++ 4.2, Hardy Heron, 32 bit.

** Attachment added: "Midterm_mStephens.tar.gz"
   http://launchpadlibrarian.net/25863845/Midterm_mStephens.tar.gz

-- 
g++-4.3 regression, rejects valid code
https://bugs.launchpad.net/bugs/354305
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to