On Tue, Feb 24, 2009 at 6:01 PM, Deji Akingunola <deji_aking(a)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.... 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(a)cs.indiana.edu
Fedora • salimma(a)fedoraproject.org
MacPorts • hircus(a)macports.org