On 2016-08-29, Chris Angelico <ros...@gmail.com> wrote: > On Mon, Aug 29, 2016 at 10:13 PM, BartC <b...@freeuk.com> wrote: >> In C, you can write this: >> >> int x; >> >> x = 5; >> x = "hello"; >> >> With certain compilers (eg. gcc) you only get a warning. (And since >> I don't show warnings to avoid inundation, that seems to compile >> fine for me!)
If you're ignoring compiler warnings, you're asking for problems and deserve whatever trouble you get. > That's because strings, in C, are really pointers-to-char, and for > hysterical raisins, pointers can be assigned to integers with just a > warning. (Good code should have an explicit cast here.) > > You probably should have warnings enabled. IMO, when doing doing development with GCC, -Wall -Werror is the absolute minimum standard. -- Grant Edwards grant.b.edwards Yow! Will it improve my at CASH FLOW? gmail.com -- https://mail.python.org/mailman/listinfo/python-list