Mail Archives: djgpp/1999/01/09/13:32:13
Johan Henriksson wrote:
>
> It took me 2 hours to fix this problem! Can't you guys implement a
> warningsignal when this kind of declarations are done? A pitfall less for us
> Basicprogrammers :)
If you compile with the -Wall switch, it will report 'warning: left-hand
operand of comma expression has no effect' for int array[10,10].
If you review the gcc documentation, there are a number of warnings that
may be enabled on the command line. If you are moving to C from BASIC,
I'd urge you to at least always use -Wall, and to investigate and
understand every warning it throws. Some may seem a little cryptic, as
in the above, but the compiler is cautioning you that you are using C in
a way that, while not exactly incorrect, is probably not what you
intended.
- Raw text -