On 2015-05-31 18:33+0100 Phil Rosenberg wrote: > Hi Alan > I'm attacking my to do list. Do you still get these warnings? I just > looked and the line 1309 no longer makes sense in terms of a reference > to cmd so I guess the code has changed since then. I don't get any > unallocated variable warnings for plbuf in VC++ so perhaps someone > else fixed this issue.
With the following compiler options: CFLAGS=-O3 -fvisibility=hidden -Wuninitialized and gcc on Linux, the following warnings are generated from building the plplot target: /home/software/plplot/HEAD/plplot.git/src/plmetafile.c: In function ‘read_header’: /home/software/plplot/HEAD/plplot.git/src/plmetafile.c:341:8: warning: ‘pdf_rc’ may be used uninitialized in this function [-Wuninitialized] /home/software/plplot/HEAD/plplot.git/src/plmetafile.c:306:9: note: ‘pdf_rc’ was declared here /home/software/plplot/HEAD/plplot.git/src/plmetafile.c: In function ‘plreadmetafile’: /home/software/plplot/HEAD/plplot.git/src/plmetafile.c:378:23: warning: ‘plm’ may be used uninitialized in this function [-Wmaybe-uninitialized] /home/software/plplot/HEAD/plplot.git/src/plmetafile.c:1117:14: note: ‘plm’ was declared here [...] /home/software/plplot/HEAD/plplot.git/src/plbuf.c: In function ‘rdbuf_bop’: /home/software/plplot/HEAD/plplot.git/src/plbuf.c:1309:11: warning: ‘cmd’ may be used uninitialized in this function [-Wmaybe-uninitialized] /home/software/plplot/HEAD/plplot.git/src/plbuf.c:593:19: note: ‘cmd’ was declared here You should be able to replicate this on your Linux box and probably also on your Cygwin platform. > On 12 March 2015 at 20:14, Alan W. Irwin <ir...@beluga.phys.uvic.ca> wrote: >> >> gcc is generating these warnings when building libplplot. Would you >> please take a look to see whether this is either a real uninitialized issue >> that needs to be fixed or a false alarm? My guess is these are all due to false alarms from gcc, but if your analysis says that is the case it is also worth squelching these warnings by dummy initializing some variables with appropriate comment like // To squelch spurious gcc uninitialized warnings PLINT i=0; // or whatever is needed so that real and useful warnings from gcc considering uninitialized variables will not be obfuscated by known false alarms. Alan __________________________ Alan W. Irwin Astronomical research affiliation with Department of Physics and Astronomy, University of Victoria (astrowww.phys.uvic.ca). Programming affiliations with the FreeEOS equation-of-state implementation for stellar interiors (freeeos.sf.net); the Time Ephemerides project (timeephem.sf.net); PLplot scientific plotting software package (plplot.sf.net); the libLASi project (unifont.org/lasi); the Loads of Linux Links project (loll.sf.net); and the Linux Brochure Project (lbproject.sf.net). __________________________ Linux-powered Science __________________________ ------------------------------------------------------------------------------ _______________________________________________ Plplot-devel mailing list Plplot-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/plplot-devel