andreas.luethi@gmx.net wrote:
>> andreas.lue...@gmx.net wrote:
>> > ... 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.
>
>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';
>}
An uneducated guess: the compiler misses the initialization in the
for(..) statement. Try this:
void aaalib_trim (char *in) {
int n = strlen(in) - 1;
for ( ; n>= 0; n--)
if (!isspace(in[n]))
break;
in[n+1] = '\0';
}
strlen(in) is always greater than 1, right?
--
Roberto Waltman
[ Please reply to the group,
return address is invalid ]