f11 g++ behaviour
Michel Salim
michel.sylvan at gmail.com
Tue Feb 24 23:49:54 UTC 2009
On Tue, Feb 24, 2009 at 6:01 PM, Deji Akingunola <deji_aking at yahoo.ca> wrote:
>
>> #include <stdio.h>
>> #include <string.h>
>> int main(int argc, char *argv[])
>> {
>> char *gr;
>> const char *pl="BlahHello world!";
>> const char *gt="Hell";
>> gr = strstr(pl, gt);
>> printf("%s\n", gr);
>> return 0;
>> }
>>
>> In f10, this compiles with g++. In f11, it compiles
>> with gcc, but not with g++. It fails with this error:
>>
>> test.cpp:8: error: invalid conversion from 'const
>> char*' to 'char*'
>>
> See https://www.redhat.com/archives/fedora-devel-list/2009-January/msg02248.html and https://www.redhat.com/archives/fedora-devel-list/2009-February/msg01576.html announcement and comment concerning this new behaviour.
>
Type-safety bugs are one class of problems that are easier to fix in
C++ than in C. Bless polymorphic type signatures.
Regards,
--
miʃel salim • http://hircus.jaiku.com/
IUCS • msalim at cs.indiana.edu
Fedora • salimma at fedoraproject.org
MacPorts • hircus at macports.org
More information about the fedora-test-list
mailing list