Afficher un message
Vieux 17/10/2007, 12h32   #5
jacob navia
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: AIX C compiler message unexplainable

andreas.luethi@gmx.net wrote:
> On Oct 17, 1:13 pm, jacob navia <ja...@nospam.org> wrote:
>> andreas.lue...@gmx.net wrote:
>>> Hi All
>>> Compile a our source with BM XL C/C++ Enterprise Edition V8.0 for AIX
>>> (Version: 08.00.0000.0000) produces a lot of Informational message
>>> like this:
>>> "aaalib.c", line 671.1: 1506-412 (I) Referenced variable "n", which
>>> was not initialized in its declaration.
>>> n is a variable in procedure an is assigned before used. Compiling the
>>> same sources with other compiles such as AIX version 7.0, gcc on
>>> linux etc do not display this information.
>>> Appreciate your in this regard,
>>> Thanks,
>>> Andreas

>> P.S. It would be maybe better to SHOW where the compiler
>> complains, where you think it is wrong with
>> concrete examples, if not it is not possible to you
>> anyway.
>>
>> --
>> jacob navia
>> jacob at jacob point remcomp point fr
>> logiciels/informatiquehttp://www.cs.virginia.edu/~lcc-win32

>
> here is the code snipped:
>
> void aaalib_trim (char *in) {
> int n;
> for (n = (strlen(in)) - 1; n>= 0; n--)
> if (!isspace(in[n]))
> break;
> in[n+1] = '\0';
> }
>
>


If the code is *exactly* as you posted then...
this looks like a bug in IBM's compiler. Note that version
Version: 08.00.0000.0000 is outdated. I have received a patch
after that one.

OR

The warning just says that you reference a variable
that was not initialized at its declaration... This could
be a very misleading warning. Try to do
> void aaalib_trim (char *in) {
> int n = 78887; // <<<<----- here
> for (n = (strlen(in)) - 1; n>= 0; n--)
> if (!isspace(in[n]))
> break;
> in[n+1] = '\0';
> }


If the warning disappears it means that this is the case.

--
jacob navia
jacob at jacob point remcomp point fr
logiciels/informatique
http://www.cs.virginia.edu/~lcc-win32
  Réponse avec citation
 
Page generated in 0,07166 seconds with 9 queries