-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Sometime soon we'll have gcc 4.4 in rawhide as the new system compiler. This alone might bring with it changes in the C++ language acceptance (I don't know details).
What I want to warn people about is another change which will come in combination with the next glibc. For a long time some of the function prototypes for string functions you get when including <cstring> and <cwchar> (or the underlying C headers) are wrong. Only for C++, C is not affected.
char *strchr (const char *, int)
should be
char *strchr (char *, int) and const char *strchr (const char *, int)
I.e., the const is preserved correctly.
The result of this that some incorrect programs might not compile anymore. For strchr this might look like this:
int foo (const char *s) { char *p = strchr (s, 'f'); return p == 0 || p[1] == '\0'; }
Previously this worked fine. strchr returned a value of type char*. Now, and correctly, it returned a const char*. But in C++ assigning a const T* value to a T* variable is an *error* (not a cause for a warning).
I expect the fixes are simple in most cases. Don't just use casts, use correct types for the variables etc. This type safety helps to eliminate bugs in the code.
- -- ➧ Ulrich Drepper ➧ Red Hat, Inc. ➧ 444 Castro St ➧ Mountain View, CA ❖
----- Original Message ----- From: "Ulrich Drepper" drepper@redhat.com To: "Development discussions related to Fedora Core" fedora-devel-list@redhat.com Sent: Thursday, January 29, 2009 7:48 PM Subject: stricter C++ prototypes
Sometime soon we'll have gcc 4.4 in rawhide as the new system compiler.
Ulrich,
I assume "sometime soon" means after Fedora 11?
--McD
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
John J. McDonough wrote:
I assume "sometime soon" means after Fedora 11?
No. F11 will use gcc 4.4. It'll land soon and AFAIK there will be a mass-rebuild using this compiler.
- -- ➧ Ulrich Drepper ➧ Red Hat, Inc. ➧ 444 Castro St ➧ Mountain View, CA ❖
Ulrich Drepper drepper@redhat.com wrote:
John J. McDonough wrote:
I assume "sometime soon" means after Fedora 11?
No. F11 will use gcc 4.4. It'll land soon and AFAIK there will be a mass-rebuild using this compiler.
Could the changed headers (at least) be pushed out (or made available somewhere) earlier to start fixing stuff? If is makes sense, timing-wise.
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Horst H. von Brand wrote:
Could the changed headers (at least) be pushed out (or made available somewhere) earlier to start fixing stuff? If is makes sense, timing-wise.
Shouldn't be necessary and it would also not be that easy since it has to be done differently for older gccs. gcc 4.4 is hopefully landing in rawhide within two weeks or so.
If somebody is interested in changing their own installed headers, take this patch
http://people.redhat.com/drepper/d-cpp-correct-proto
In addition the installed <cstring> and <wchar> have to be changed. The declarations in those files have to be removed.
- -- ➧ Ulrich Drepper ➧ Red Hat, Inc. ➧ 444 Castro St ➧ Mountain View, CA ❖
tor 2009-01-29 klockan 16:48 -0800 skrev Ulrich Drepper:
Sometime soon we'll have gcc 4.4 in rawhide as the new system compiler.
That rocks!
Martin Michlmayr from Debian rebuilt all of their packages with GCC 4.4 recently, hm well september last year, and so was already back then quite painless it appears: http://lwn.net/Articles/298560/
Linus