Bug#731435: warning: iteration 55823u invokes undefined behavior [-Waggressive-loop-optimizations]
On Mon, Apr 06, 2020 at 10:29:35AM +0200, Mathieu Malaterre wrote: > http://git.dcmtk.org/?p=dcmtk.git;a=commit;h=180d9b9 I have to say that I don't see how the changes to jccolor.c solve the problem ... the warning that we have is about this line: rgb_ycc_tab[i+G_Y_OFF] = FIX(0.58700) * i; This is round(0.58700 * 65536) * 55823 = 2147510810, which exceeds INT32_MAX and therefore cannot be stored in rgb_ycc_tab, no matter how many casts you use. Berto
Bug#731435: warning: iteration 55823u invokes undefined behavior [-Waggressive-loop-optimizations]
Control: tags -1 patch On Sun, Apr 5, 2020 at 8:27 PM Alberto Garcia wrote: > > On Thu, Dec 05, 2013 at 02:00:59PM +0100, Mathieu Malaterre wrote: > > /«PKGBUILDDIR»/Utilities/gdcmjpeg/jccolor.c: In function 'rgb_ycc_start': > > /«PKGBUILDDIR»/Utilities/gdcmjpeg/jccolor.c:99:43: warning: iteration > > 55823u invokes undefined behavior [-Waggressive-loop-optimizations] > > rgb_ycc_tab[i+G_Y_OFF] = FIX(0.58700) * i; > >^ > > /«PKGBUILDDIR»/Utilities/gdcmjpeg/jccolor.c:97:3: note: containing loop > >for (i = 0; i <= MAXJSAMPLE; i++) { > >^ > > This has already been reported upstream, and it seems exactly the same > as #731433, which was fixed upstream in DCMTK: > >https://support.dcmtk.org/redmine/issues/759 > > Berto > http://git.dcmtk.org/?p=dcmtk.git;a=commit;h=180d9b9
Bug#731435: warning: iteration 55823u invokes undefined behavior [-Waggressive-loop-optimizations]
On Thu, Dec 05, 2013 at 02:00:59PM +0100, Mathieu Malaterre wrote: > /«PKGBUILDDIR»/Utilities/gdcmjpeg/jccolor.c: In function 'rgb_ycc_start': > /«PKGBUILDDIR»/Utilities/gdcmjpeg/jccolor.c:99:43: warning: iteration > 55823u invokes undefined behavior [-Waggressive-loop-optimizations] > rgb_ycc_tab[i+G_Y_OFF] = FIX(0.58700) * i; >^ > /«PKGBUILDDIR»/Utilities/gdcmjpeg/jccolor.c:97:3: note: containing loop >for (i = 0; i <= MAXJSAMPLE; i++) { >^ This has already been reported upstream, and it seems exactly the same as #731433, which was fixed upstream in DCMTK: https://support.dcmtk.org/redmine/issues/759 Berto
Bug#731435: warning: iteration 55823u invokes undefined behavior [-Waggressive-loop-optimizations]
Package: gdcm gdcm currently compiles with: cd /«PKGBUILDDIR»/obj-i486-linux-gnu/Utilities/gdcmjpeg/8 /usr/bin/cc -Dgdcmjpeg8_EXPORTS -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fPIC -I/«PKGBUILDDIR»/Utilities/gdcmjpeg/8 -I/«PKGBUILDDIR»/obj-i486-linux-gnu/Utilities/gdcmjpeg/8 -I/«PKGBUILDDIR»/obj-i486-linux-gnu/Utilities/gdcmjpeg-o CMakeFiles/gdcmjpeg8.dir/__/jccolor.c.o -c /«PKGBUILDDIR»/Utilities/gdcmjpeg/jccolor.c /«PKGBUILDDIR»/Utilities/gdcmjpeg/jccolor.c: In function 'rgb_ycc_start': /«PKGBUILDDIR»/Utilities/gdcmjpeg/jccolor.c:99:43: warning: iteration 55823u invokes undefined behavior [-Waggressive-loop-optimizations] rgb_ycc_tab[i+G_Y_OFF] = FIX(0.58700) * i; ^ /«PKGBUILDDIR»/Utilities/gdcmjpeg/jccolor.c:97:3: note: containing loop for (i = 0; i = MAXJSAMPLE; i++) { ^ /usr/bin/cmake -E cmake_progress_report /«PKGBUILDDIR»/obj-i486-linux-gnu/CMakeFiles -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org