This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


>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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]