develooper Front page | perl.perl5.porters | Postings from April 2000

RE: [ID 20000403.009] uninitialised concatenation???

Thread Previous | Thread Next
Konovalov, Vadim
April 4, 2000 07:46
RE: [ID 20000403.009] uninitialised concatenation???
Message ID:
> From: Richard Foley []
> Tom Christiansen wrote:
> > 
> > >How about the much less inflamatory, and much more useful:
> > 
> > How about addressing the real issue?
> > 
> > % perl -lwe '@a[0,2] = (0,2); print "@a $a", "$a", $a'
> > Use of uninitialized value in join at -e line 1.
> > Use of uninitialized value in concatenation (.) at -e line 1.
> > Use of uninitialized value in string at -e line 1.
> > Use of uninitialized value in print at -e line 1.
> > 
> > Those are all different cases.  They should not be conflated just
> > to stick a pacifier in the mouths of the confused, because that
> It seems a shame to have to use another language, just 
> because a couple of
> warnings confuse once in a while.

Why so many people are confusing? If one have brain then such warnings may
be understood clearly. If that warning is misleading, why other compiler's
warnings are easily understood?


#include <stdio.h>
typedef int my_type;
void main () {
  my_type a;

d:\TESTS\x>cl a.c
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 12.00.8168 for 80x86
Copyright (C) Microsoft Corp 1984-1998. All rights reserved.

a.c(5) : warning C4047: 'function' : 'const char *' differs in levels of
indirection from 'int '
a.c(5) : warning C4024: 'printf' : different types for formal and actual
parameter 1
a.c(5) : warning C4700: local variable 'a' used without having been
Microsoft (R) Incremental Linker Version 6.00.8447
Copyright (C) Microsoft Corp 1992-1998. All rights reserved.


BROKEN: a is 'my_type', not 'int '

d:\TESTS\x>gcc a.c
a.c: In function `main':
a.c:5: warning: passing arg 1 of `printf' makes pointer from integer without
a cast
a.c:3: warning: return type of `main' is not `int'

BROKEN: a is 'my_type', not integer

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About