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]

variable âsomethingâ set but not used [-W unused-but-set-variable]



dear all,
GCC-4.6 says this warning
ÂÂÂ 

syscall.c:1011:15: warning: variable âfullpath_lengthâ set but not used [-Wunused-but-set-variable]


However in the code, I see

ÂÂÂ ÂÂÂ int length, fullpath_length;ÂÂÂ // warning at this line
ÂÂÂ ÂÂÂ int host_fd;
ÂÂÂ ÂÂÂ struct fd_t *fd;

ÂÂÂ ÂÂÂ /* Read parameters */
ÂÂÂ ÂÂÂ pfilename = isa_regs->ebx;
ÂÂÂ ÂÂÂ flags = isa_regs->ecx;
ÂÂÂ ÂÂÂ mode = isa_regs->edx;
ÂÂÂ ÂÂÂ length = mem_read_string(isa_mem, pfilename, MAX_PATH_SIZE, filename);
ÂÂÂ ÂÂÂ if (length >= MAX_PATH_SIZE)
ÂÂÂ ÂÂÂ ÂÂÂ fatal("syscall open: maximum path length exceeded");
ÂÂÂ ÂÂÂ ld_get_full_path(isa_ctx, filename, fullpath, MAX_PATH_SIZE);
ÂÂÂ ÂÂÂ fullpath_length = strlen(fullpath);ÂÂÂÂ // variable is used here

Â
As you can see fullpath_length is defined as 'int' and is used at the end of the code.
Any way to fix that?


// Naderan *Mahmood;


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