[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 3 Jul 2013, Dave Jones wrote:

> btw, here's something curious that llvm finds when you build trinity with clang.
> I'm not sure if this is a real problem, or a bug in the compiler, but you
> might want to take a look anyway:
> 
> syscalls/perf_event_open.c:66:19: warning: Assigned value is garbage or undefined
>                 format_string[i]=string[i];
>                                 ^~~~~~~~~~
> syscalls/perf_event_open.c:159:12: warning: Assigned value is garbage or undefined
>                         field[i]=value[ptr];
>                                 ^~~~~~~~~~~
> 
> In case you're not setup for llvm, I've put the decision trees it generated at
> http://codemonkey.org.uk/junk/1.html
> http://codemonkey.org.uk/junk/2.html

I'll see if I can figure out llvm, I've been wanting an excuse to look 
into it.

The values that it is complaining about are gathered via a fscanf followed 
by a strdup, so in theory if the fscanf fails (due to the file being 
empty) or if strdup() fails (due to OOM) it is indeed possible the string 
is garbage.  I can add handling for those conditions to see if it helps.

Vince
--
To unsubscribe from this list: send the line "unsubscribe trinity" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux SCSI]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux