<AWT Dev> splashscreen_png.c compile error with gcc 4.9.2
Alexander Zvegintsev
alexander.zvegintsev at oracle.com
Tue May 19 13:59:55 UTC 2015
Hi Peter,
I think that your solution can be simplified to:
diff -r 729dffc8afa0
src/java.desktop/share/native/libsplashscreen/splashscreen_png.c
--- a/src/java.desktop/share/native/libsplashscreen/splashscreen_png.c
+++ b/src/java.desktop/share/native/libsplashscreen/splashscreen_png.c
@@ -77,6 +77,8 @@ SplashDecodePng(Splash * splash, png_rw_
#else
if (setjmp(png_jmpbuf(png_ptr))) {
#endif
+ row_pointers = NULL;
+ image_data = NULL;
goto done;
}
As another solution you can declare row_pointers and image_data as volatile.
BTW, Could you please file an issue?
Thanks,
Alexander.
On 05/19/2015 01:50 PM, Peter Levart wrote:
> Hi,
>
> I hope this is the right thread to post the observation.
>
> Building recent OpenJDK 9 from sources on Fedora 21 fails with this:
>
> /home/peter/work/hg/jdk9-dev/jdk/src/java.desktop/share/native/libsplashscreen/splashscreen_png.c:
> In function 'SplashDecodePng':
> /home/peter/work/hg/jdk9-dev/jdk/src/java.desktop/share/native/libsplashscreen/splashscreen_png.c:51:16:
> error: variable 'row_pointers' might be clobbered by 'longjmp' or
> 'vfork' [-Werror=clobbered]
> png_bytepp row_pointers = NULL;
> ^
> /home/peter/work/hg/jdk9-dev/jdk/src/java.desktop/share/native/libsplashscreen/splashscreen_png.c:52:15:
> error: variable 'image_data' might be clobbered by 'longjmp' or
> 'vfork' [-Werror=clobbered]
> png_bytep image_data = NULL;
> ^
> cc1: all warnings being treated as errors
> gmake[3]: ***
> [/home/peter/work/hg/jdk9-dev/build/linux-x86_64-normal-server-release/support/native/java.desktop/libsplashscreen/splashscreen_png.o]
> Error 1
> gmake[3]: *** Waiting for unfinished jobs....
> Awt2dLibraries.gmk:879: recipe for target
> '/home/peter/work/hg/jdk9-dev/build/linux-x86_64-normal-server-release/support/native/java.desktop/libsplashscreen/splashscreen_png.o'
> failed
> gmake[2]: *** [java.desktop-libs] Error 1
> make/Main.gmk:168: recipe for target 'java.desktop-libs' failed
>
>
> I found that making the following change eliminates the compiler error:
>
> http://cr.openjdk.java.net/~plevart/jdk9-dev/splashscreen_png/webrev.01/
>
> Is this the right way to fix it?
>
> Regards, Peter
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/awt-dev/attachments/20150519/c1ad28d7/attachment-0001.html>
More information about the awt-dev
mailing list