Quoting "Dallman, John" <[email protected]>: > Tom Hughes [mailto:[email protected]] >> [email protected] wrote: >> > However it is possible to pack the structs without holes... >> You're going to recompile glibc and all the other libraries that your >> program uses with that option are you? > > And, of course, if you don't, structs passed between packed and unpacked > code aren't compatible. Members of the structs will be at different > offsets as far the two sets of code are concerned. The effects of this > are > undefined in the most comprehensive sense of the term: your computer is > quite unlikely to catch fire, but if it does, it was your fault.
Oh yes, I forgot about those :) You have a good point, but still, the effort for recompiling the libraries and other required code for this purpose might be much less than trying to find an uninitialized variable in some cumbersome code. For example I could download the whole source tree for FreeBSD OS and re-compile with this compiler option (including kernel and all the libraries shipped with the OS) in about an hour or two (in which case this system can be used several times for debugging code without repeating this action). In comparison, even finding the source of a single uninitialized variable can take much longer time. So, the difficulty of finding an uninitialized variable (or many of them) can easily outweigh the difficulty of recompiling the libraries once for this purpose. Lets say that all of the difficulties we discussed until now have been resolved. Is there any other reason for valgrind not to do eager checking for this? Thanks, Evren ------------------------------------------------------------------------------ SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada. The future of the web can't happen without you. Join us at MIX09 to help pave the way to the Next Web now. Learn more and register at http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/ _______________________________________________ Valgrind-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/valgrind-users
