|
From: | Dr . Jürgen Sauermann |
Subject: | Re: I get ompile errors in 1788 |
Date: | Fri, 27 Sep 2024 13:26:33 +0200 |
User-agent: | Mozilla Thunderbird |
Peter,
I've seen these warnings in Quad_PNG.cc - they appear to be harmless. I've re-written the definitions of both PNG_GTK and PNG_LIBS so that they are no longer flagged by the compileras potentially undefined behavior and probably are considered to be better practice: I've copied a diff of my code vs that in SVN 1780 created via 'svn diff':
I've seen the warnings in filter_apl_lines.cc that appear to be typecasting mismatches. I haven't seen the warnings out of lines.cc.
- Paul Rockwell
Index: src/Quad_PNG.cc
===================================================================
--- src/Quad_PNG.cc (revision 1780)
+++ src/Quad_PNG.cc (working copy)
@@ -41,18 +41,24 @@
/// PNG_GTK defines whether ⎕PNG B with ⍴⍴B ←→ 3 (display of a PNG file in a
/// GTK window shall be supported, Requires libgtk in addition to libnpng.
-#define PNG_GTK \
- apl_X11 && \
+#if apl_X11 && \
defined( apl_GTK3 ) && \
- defined( HAVE_LIBGTK_3 )
+ defined( HAVE_LIBGTK_3 )
+#define PNG_GTK 1
+#else
+#define PNG_GTK 0
+#endif
/// PNG_LIBS defines if the PNG related libraries (and their header files)
/// are present
-#define PNG_LIBS \
- defined( HAVE_LIBZ ) && \
+#if defined( HAVE_LIBZ ) && \
defined( HAVE_ZLIB_H ) && \
defined( HAVE_LIBPNG ) && \
defined( HAVE_LIBPNG16_PNG_H )
+#define PNG_LIBS 1
+#else
+$define PNG_LIBS 0
+#endif
#if PNG_LIBS
# include <zlib.h>
On Sep 26, 2024, at 3:25 PM, Peter Teeson <pteeson@me.com> wrote:
Here are abstracts from my build attempt. The complete log is attached at the bottom of this email….
macOS High Sierra 13.6.
Last login: Thu Sep 26 13:25:07 on ttys000
Gandalf:GNUaplfiles pteeson$ svn co http://svn.savannah.gnu.org/svn/apl/trunk > svn-log 2>&1
Gandalf:GNUaplfiles pteeson$ cd trunk
Gandalf:trunk pteeson$ ./configure
*** core tests... ***
checking for gcc... gcc
checking whether the C compiler works... yes
……
config.status: executing libtool commands
configure: ---- SUMMARY OF TESTS (please include in error reports) ----
prefix: : /usr/local
DEVELOP_WANTED: no
ASSERT_LEVEL_WANTED: 1
DYNAMIC_LOG_WANTED: no
PERFORMANCE_COUNTERS_WANTED: no
VALUE_CHECK_WANTED: no
VALUE_HISTORY_WANTED: no
apl_MAINTAINER_MODE: no
apl_missing_headers: 3
apl_missing_functions: 0
apl_FFT: no (affects: ⎕FFT)
apl_PCRE: no (affects: ⎕RE)
apl_PNG: yes (affects: ⎕PNG)
apl_POSTGRES: no (may affect: ⎕SQL)
apl_SQLITE3: yes (may affect: ⎕SQL)
apl_SQL yes (affects: ⎕SQL)
apl_X11 (libxcb): no (fallback for ⎕PLOT)
apl_GTK3: no (affects: ⎕PNG, ⎕GTK, maybe ⎕PLOT)
apl_GUI: no (affects: ⎕PNG, ⎕GTK, ⎕PLOT)
Gandalf:trunk pteeson$ make
/Library/Developer/CommandLineTools/usr/bin/make all-recursive
Making all in workspaces
make[2]: Nothing to be done for `all'.
Making all in wslib3
Making all in DALY
…..
Quad_PNG.cc:57:5: warning: macro expansion producing 'defined' has undefined behavior [-Wexpansion-to-defined]
#if PNG_LIBS
^
Quad_PNG.cc:52:5: note: expanded from macro 'PNG_LIBS'
defined( HAVE_LIBZ ) && \
^
Quad_PNG.cc:57:5: warning: macro expansion producing 'defined' has undefined behavior [-Wexpansion-to-defined]
Quad_PNG.cc:53:5: note: expanded from macro 'PNG_LIBS'
defined( HAVE_ZLIB_H ) && \
^
…..
Quad_PNG.cc:721:5: warning: macro expansion producing 'defined' has undefined behavior [-Wexpansion-to-defined]
Quad_PNG.cc:47:5: note: expanded from macro 'PNG_GTK'
defined( HAVE_LIBGTK_3 )
^
36 warnings generated.
<Build-2024-09-26-2.52PM.txt>
[Prev in Thread] | Current Thread | [Next in Thread] |