From: <ai...@us...> - 2013-10-26 20:47:51
|
Revision: 12636 http://sourceforge.net/p/plplot/code/12636 Author: airwin Date: 2013-10-26 20:47:49 +0000 (Sat, 26 Oct 2013) Log Message: ----------- Quiet -O1 -Wuninitialized warnings that all proved to be false alarms. Tested by Alan W. Irwin <ai...@us...> using the install target. No uninitialized warnings occurred other than for the remaining such warnings from the swig-generated bindings code for Python, Lua, and Octave (but not for Java which may give a clue for what to do for those other languages). Modified Paths: -------------- trunk/src/plbuf.c trunk/src/pllegend.c trunk/src/plvect.c Modified: trunk/src/plbuf.c =================================================================== --- trunk/src/plbuf.c 2013-10-26 18:59:10 UTC (rev 12635) +++ trunk/src/plbuf.c 2013-10-26 20:47:49 UTC (rev 12636) @@ -771,8 +771,14 @@ static void rdbuf_image( PLStream *pls ) { + // Unnecessarily initialize dev_iy and dev_z to quiet -O1 + // -Wuninitialized warnings which are false alarms. (If something + // goes wrong with the dev_ix malloc below any further use of + // dev_iy and dev_z does not occur. Similarly, if something goes + // wrong with the dev_iy malloc below any further use of dev_z + // does not occur.) short *dev_ix, *dev_iy = NULL; - unsigned short *dev_z, dev_zmin, dev_zmax; + unsigned short *dev_z = NULL, dev_zmin, dev_zmax; PLINT nptsX, nptsY, npts; PLFLT xmin, ymin, dx, dy; Modified: trunk/src/pllegend.c =================================================================== --- trunk/src/pllegend.c 2013-10-26 18:59:10 UTC (rev 12635) +++ trunk/src/pllegend.c 2013-10-26 20:47:49 UTC (rev 12636) @@ -1531,7 +1531,11 @@ // Min and max values // Assumes that the values array is sorted from smallest to largest // OR from largest to smallest. - PLFLT min_value, max_value, max_abs; + // Unnecessarily initialize min_value, max_value, and max_abs + // to quiet -O1 -Wuninitialized warnings that are false alarms. + // (n_axes is guaranteed to be 1 or greater so that the loops that + // define these values must be executed at least once.) + PLFLT min_value = 0., max_value = 0., max_abs = 0.; // Length of cap in orientation direction in normalized subpage // coordinates and mm. PLFLT cap_extent, cap_extent_mm; Modified: trunk/src/plvect.c =================================================================== --- trunk/src/plvect.c 2013-10-26 18:59:10 UTC (rev 12635) +++ trunk/src/plvect.c 2013-10-26 20:47:49 UTC (rev 12636) @@ -68,7 +68,10 @@ plP_plotvect( PLFLT x, PLFLT y, PLFLT u, PLFLT v, PLFLT scale ) { PLFLT uu, vv, px0, py0, dpx, dpy; - PLINT *a_x, *a_y; + // Unnecessarily initialize a_y to quiet a -O1 -Wuninitialized warning + // which is a false alarm. (If something goes wrong with the + // a_x malloc below any further use of a_y does not occur.) + PLINT *a_x, *a_y = NULL; int j; uu = scale * u; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |