Re: variable ‘something’ set but not used [-Wunused-but-set-variable]

Mahmood Naderan nt_mahmood@yahoo.com
Tue Jul 12 18:21:00 GMT 2011


>No, it's not.  It's a set of fullpath_length.


Sorry something is not clear for me.
what does this mean

int i;
i = 0;

I defined a variable and used it.

If fullpath_length is not really used, I should not receive any error by commenting that. Like this:
   

int length/*, fullpath_length*/;

But I get this error

syscall.c:1023:3: error: ‘fullpath_length’ undeclared (first use in this function)


the line it points is
fullpath_length = strlen(fullpath);


// Naderan *Mahmood;


----- Original Message -----
From: Andrew Haley <aph@redhat.com>
To: Mahmood Naderan <nt_mahmood@yahoo.com>
Cc: gcc <gcc-help@gcc.gnu.org>
Sent: Tuesday, July 12, 2011 10:43 PM
Subject: Re: variable ‘something’ set but not used [-Wunused-but-set-variable]

On 07/12/2011 07:12 PM, Mahmood Naderan wrote:
>> The message is correct.  fullpath_length is set, but not used.
>  
> Hi
> What is this then
> 
>      fullpath_length = strlen(fullpath);     // variable is used here
> 
> isn't a usage of fullpath_length?



No, it's not.  It's a set of fullpath_length.

Andrew.



More information about the Gcc-help mailing list