gcc/g++ version

7 views
Skip to first unread message

Brian B.

unread,
Jul 4, 2010, 12:18:14 AM7/4/10
to
I noticed that the IOI will be using g++ 4.4 this year.

In my opinion, the upgrade from g++ 4.1, used in Bulgaria last year,
not only is unnecessary but will inconvenience many competitors.
Indeed, using 4.4 confers no benefit that I can think of but has a
number of disadvantages such as:
* the >?, <?, >?=, and <?= operators have been removed.
* the <iostream> header no longer automatically includes <cstdio>.
* memset() and memcpy() are only available when <cstring> is included
(formerly including any of the STL headers would suffice).

More seriously, versions of g++ after 4.1 are buggy; I myself have
reported a bug that occurs in 4.4 and later (http://gcc.gnu.org/
bugzilla/show_bug.cgi?id=44731 ). Because the occurrence of this bug
is unpredictable to one who has not investigated it, and could cause
considerable confusion for competitors, I claim that this alone should
be enough to disqualify g++-4.4 from use at the IOI. (This is not
fixed in g++-4.5, and in fact g++-4.5 has even worse issues with debug
information, including causing gdb to report that a line doesn't exist
in the source file whereas in actual fact it does.)

There may be a point in the future when it would be a good idea to
upgrade from 4.1 (presumably when the advantages outweigh the
disadvantages, maybe when g++ fully supports C++0x) but I don't think
it is a good idea now. (I want to point out also that when SPOJ
upgraded g++ to 4.3, enough users complained that the admins also
retained g++-4.0.)

gvc

unread,
Jul 4, 2010, 8:11:56 AM7/4/10
to
The IOI uses new hardware every year, which, of course, comes with new
software. This year, the software platform is Ubuntu 10.04, for which
the current gcc version is 4.4. We have no capacity to backlevel the
gcc installation at this time, and believe that to attempt to do so
would increase risk and decrease transparency.

Martin Mares

unread,
Jul 4, 2010, 8:31:23 AM7/4/10
to
I do not see things like "<iostream> no longer includes <cstdio>" as
valid disadvantages -- any code which relies on <cstdio> being
included automatically via some other header file is simply buggy and
it should be fixed. If you want to use memset(), you simply should
include <cstring>, that's what the language standard says and you
should not bend the compiler (or ask others to do that) to get your
program compile.

As of compiler bugs: Yes, there are bugs in GCC 4.4 which make it
produce incorrect code, but such bugs have been found in all versions
of GCC so far (or of any other compiler, except maybe for compilers
which nobody uses). GCC 4.1 is no exception, I have personally
reported a couple of nasty code generation bugs in it. So downgrading
the compiler does not really help.

Prateek Karandikar

unread,
Jul 5, 2010, 4:11:35 AM7/5/10
to
There are no >? etc operators in the C++ language. Headers are not
guaranteed to include or not include other headers - it is the
programmer's responsibility to include the correct headers for the
parts of the standard library they're using.
Reply all
Reply to author
Forward
0 new messages