473,396 Members | 1,938 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

gcc4

I saw that GCC4 is out, anybody knows how well C99 is implemented or where
to find the info?
Nov 14 '05 #1
7 1954
Have a look at: http://gcc.gnu.org/gcc-4.0/c99status.html

"Servé Laurijssen" <bl****@bleat.com> wrote in message
news:11*************@corp.supernews.com...
I saw that GCC4 is out, anybody knows how well C99 is implemented or where
to find the info?

Nov 14 '05 #2
Servé Laurijssen wrote:
I saw that GCC4 is out, anybody knows how well C99 is implemented or where
to find the info?

http://gcc.gnu.org/gcc-4.0/c99status.html
Nov 14 '05 #3
In article <3M*********************@newsc.telia.net>, August Karlstrom wrote:
Servé Laurijssen wrote:
I saw that GCC4 is out, anybody knows how well C99 is implemented or where
to find the info?

http://gcc.gnu.org/gcc-4.0/c99status.html


Another page worth reading is

http://gcc.gnu.org/gcc-4.0/changes.html

The Caveats sections of gcc's changes pages are always particularly
interesting from a portability standpoint because they tell you about
the deprecation and removal of nonstandard gcc features. The 4.0 series,
for example, removes support for the -fwritable-strings option (which
permits a program to modify string constants, causing undefined behavior
according to ISO C), so there may be much broken legacy code out there
that will have to be fixed for 4.x.

--
Nils R. Weller, Bremen / Germany
My real email address is ``nils<at>gnulinux<dot>nl''
.... but I'm not speaking for the Software Libre Foundation!
Nov 14 '05 #4
Nils Weller <me@privacy.net> wrote:
the deprecation and removal of nonstandard gcc features. The 4.0 series,
for example, removes support for the -fwritable-strings option (which
permits a program to modify string constants, causing undefined behavior
according to ISO C), so there may be much broken legacy code out there
that will have to be fixed for 4.x.


Good. Code which relies on this option is broken in the first place, so
forcing its repair is a beneficial effect.

Richard, mildly surprised at this new clue shown by gcc
Nov 14 '05 #5
In article <42****************@news.xs4all.nl>, Richard Bos wrote:
Nils Weller <me@privacy.net> wrote:
the deprecation and removal of nonstandard gcc features. The 4.0 series,
for example, removes support for the -fwritable-strings option (which
permits a program to modify string constants, causing undefined behavior
according to ISO C), so there may be much broken legacy code out there
that will have to be fixed for 4.x.


Good. Code which relies on this option is broken in the first place, so
forcing its repair is a beneficial effect.

Richard, mildly surprised at this new clue shown by gcc


Obviously, I agree with the essence of your statement, but I don't agree
with the implied criticism of the gcc team for introducing this option
in the first place ...

gcc is a large project that addresses the needs of a wide variety of
users. Some of these users still have to deal with pre-ANSI C code
today, whereas many others had to deal with it at one time or another,
particularly in the first couple of years after the adoption of ANSI C
(remember that gcc was already around before C89 was even finished.) As
you may know, K&R C did not forbid you to modify string constants. A
classical example of a place where some people chose to use a string
constant in place of a modifyable character array is the Unix function
mktemp(), which modifies its string argument.

ANSI C says that attempting to modify a string constant invokes
``undefined behavior''; An unfortunate side effect of this fact is that
any code which does this, while illegal, may happen to work just as
expected - with K&R C semantics! Therefore, some ANSI compilers (Borland
comes to mind) still choose to make string constants writable by
default, so that even new code may be broken in this way *by accident*.

The -fwritable-strings option (which is implied by gcc's -traditional
option, by the way) does not exist so that you can write code that
modifies string constants; It exists so that you can more easily port
(presumably pre-ANSI) code that relies on this ability. Thus, it does a
service to those who need to get the job done as quickly and as easily
as possible, and there are many potential cases where this feature works
just fine and the problem is never encountered again. And it's just one
of many system software inventions that exist solely to provide
compatibility with legacy and/or nonportable code. Other examples are
the ability to dereference null pointers and misaligned load/store
instruction emulation for architectures that do not naturally support
this.

In any case, it's important to keep in mind that gcc's user community
does not only consist of people who care about code correctness, and not
everyone will always agree that it's better to fix the code than to use
a compiler option like this one. Perhaps you will only have to use the
code once and can throw it away afterwards. Compatibility features to
run nonportable code tend to address the needs of an ``end user''; An
end user of a program does not care about code quality and correctness,
he may not be capable of debugging the code, and it just has to work no
matter how. If you *abuse* a compatibility feature as a means to write
buggy, yet working code, then it's not the fault of the implementor.

--
Nils R. Weller, Bremen / Germany
My real email address is ``nils<at>gnulinux<dot>nl''
.... but I'm not speaking for the Software Libre Foundation!
Nov 14 '05 #6
not pertinent
"Servé Laurijssen" <bl****@bleat.com> wrote in message
news:11*************@corp.supernews.com...
I saw that GCC4 is out, anybody knows how well C99 is implemented or where
to find the info?

Nov 15 '05 #7
BGreene <ba****@highstream.net> wrote:
not pertinent
"Serv? Laurijssen" <bl****@bleat.com> wrote in message
news:11*************@corp.supernews.com...
I saw that GCC4 is out, anybody knows how well C99 is implemented or where
to find the info?


About as well as GCC3.4, or GCC3.3.

http://gcc.gnu.org/c99status.html

Nov 15 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

34
by: Marcel van Kervinck | last post by:
Dear all, I would like to confirm my suspicion of a compiler bug in gcc4 for MacOSX. The code example below expects that the initializer of 'v' sets all elements in v.u.bytes to zero, as...
2
by: LewGun | last post by:
at the end of last year Herb Sutter told us that "C++ 0x has been fixed", now GCC4.3 had been released, the compiler were known as "the C ++ new features' experimental unit",but it support to the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.