Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

few warnings during a build #1747

Open
eirnym opened this issue Jul 21, 2020 · 0 comments
Open

few warnings during a build #1747

eirnym opened this issue Jul 21, 2020 · 0 comments

Comments

@eirnym
Copy link

eirnym commented Jul 21, 2020

Describe the bug
Building on macOS using clang as a compiler. Few warnings catch my eye:

  • logical-op-parentheses
	clang++ -DHAVE_CONFIG_H -I. -I../..  -I../../include -Wno-int-to-void-pointer-cast   -Wno-address-of-packed-member   -Wno-format-zero-length   -Wno-missing-field-initializers   -Wno-strict-aliasing   -Wno-implicit-fallthrough   -Wno-deprecated-declarations   -Wconversion-null   -Wsign-promo   -pedantic   -Wunused   -Wextra   -Wall   -I/opt/local/include -I/opt/local/include/SDL2 -D_THREAD_SAFE -I/opt/local/include/freetype2 -I/opt/local/include/libpng16 -I/opt/local/include -I/opt/local/include  -g -std=c++11  -O2 -msse  -Wall   -Wextra   -Wunused   -pedantic   -Wsign-promo   -Wconversion-null   -Wno-deprecated-declarations   -Wno-implicit-fallthrough   -Wno-strict-aliasing   -Wno-missing-field-initializers   -Wno-format-zero-length   -Wno-address-of-packed-member   -Wno-int-to-void-pointer-cast   -MT dos_misc.o -MD -MP -MF $depbase.Tpo -c -o dos_misc.o dos_misc.cpp &&\
	mv -f $depbase.Tpo $depbase.Po
dos_misc.cpp:366:68: warning: '&&' within '||' [-Wlogical-op-parentheses]
                if (uselfn && (!strcmp(psp_name, "NESTICLE") || reg_sp == 0x220A && mem_readw(SegPhys(ss)+reg_sp)/0x100 == 0x1F)) {
                                                             ~~ ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
dos_misc.cpp:366:68: note: place parentheses around the '&&' expression to silence this warning
                if (uselfn && (!strcmp(psp_name, "NESTICLE") || reg_sp == 0x220A && mem_readw(SegPhys(ss)+reg_sp)/0x100 == 0x1F)) {
                                                                ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
  • format-security
	clang++ -DHAVE_CONFIG_H -I. -I../..  -I../../include -I../../src/aviwriter "-DRESDIR=\"\"" -I../../src -I../../src/mt32 -Wno-int-to-void-pointer-cast   -Wno-address-of-packed-member   -Wno-format-zero-length   -Wno-missing-field-initializers   -Wno-strict-aliasing   -Wno-implicit-fallthrough   -Wno-deprecated-declarations   -Wconversion-null   -Wsign-promo   -pedantic   -Wunused   -Wextra   -Wall   -I/opt/local/include -I/opt/local/include/SDL2 -D_THREAD_SAFE -I/opt/local/include/freetype2 -I/opt/local/include/libpng16 -I/opt/local/include -I/opt/local/include  -g -std=c++11  -O2 -msse  -Wall   -Wextra   -Wunused   -pedantic   -Wsign-promo   -Wconversion-null   -Wno-deprecated-declarations   -Wno-implicit-fallthrough   -Wno-strict-aliasing   -Wno-missing-field-initializers   -Wno-format-zero-length   -Wno-address-of-packed-member   -Wno-int-to-void-pointer-cast   -MT midi.o -MD -MP -MF $depbase.Tpo -c -o midi.o midi.cpp &&\
	mv -f $depbase.Tpo $depbase.Po
In file included from midi.cpp:100:
./midi_synth.h:44:26: warning: format string is not a string literal (potentially insecure) [-Wformat-security]
                LOG(LOG_ALL,LOG_ERROR)(message);
                                       ^~~~~~~
./midi_synth.h:44:26: note: treat the string as an argument to avoid this
                LOG(LOG_ALL,LOG_ERROR)(message);
                                       ^
                                       "%s", 
./midi_synth.h:48:25: warning: format string is not a string literal (potentially insecure) [-Wformat-security]
                LOG(LOG_ALL,LOG_WARN)(message);
                                      ^~~~~~~
./midi_synth.h:48:25: note: treat the string as an argument to avoid this
                LOG(LOG_ALL,LOG_WARN)(message);
                                      ^
                                      "%s", 
./midi_synth.h:52:27: warning: format string is not a string literal (potentially insecure) [-Wformat-security]
                LOG(LOG_ALL,LOG_NORMAL)(message);
                                        ^~~~~~~
./midi_synth.h:52:27: note: treat the string as an argument to avoid this
                LOG(LOG_ALL,LOG_NORMAL)(message);
                                        ^
                                        "%s", 
3 warnings generated.
  • deprecated-register (C++17)
	clang++ -DHAVE_CONFIG_H -I. -I..  -I../include "-DRESDIR=\"/opt/local/share/dosbox-x\"" -Wno-int-to-void-pointer-cast   -Wno-address-of-packed-member   -Wno-format-zero-length   -Wno-missing-field-initializers   -Wno-strict-aliasing   -Wno-implicit-fallthrough   -Wno-deprecated-declarations   -Wconversion-null   -Wsign-promo   -pedantic   -Wunused   -Wextra   -Wall   -I/opt/local/include -I/opt/local/include/SDL2 -D_THREAD_SAFE -I/opt/local/include/freetype2 -I/opt/local/include/libpng16 -I/opt/local/include -I/opt/local/include  -g -std=c++11  -O2 -msse  -Wall   -Wextra   -Wunused   -pedantic   -Wsign-promo   -Wconversion-null   -Wno-deprecated-declarations   -Wno-implicit-fallthrough   -Wno-strict-aliasing   -Wno-missing-field-initializers   -Wno-format-zero-length   -Wno-address-of-packed-member   -Wno-int-to-void-pointer-cast   -MT dosbox.o -MD -MP -MF $depbase.Tpo -c -o dosbox.o dosbox.cpp &&\
	mv -f $depbase.Tpo $depbase.Po
In file included from dosbox.cpp:83:
In file included from ../vs2015/zlib/contrib/minizip/zip.c:186:
../vs2015/zlib/contrib/minizip/crypt.h:54:7: warning: 'register' storage class specifier is deprecated and incompatible with C++17 [-Wdeprecated-register]
      register int keyshift = (int)((*(pkeys+1)) >> 24);
      ^~~~~~~~~
1 warning generated.
  • and a few unused functions:
	clang++ -DHAVE_CONFIG_H -I. -I../..  -I../../include -Wno-int-to-void-pointer-cast   -Wno-address-of-packed-member   -Wno-format-zero-length   -Wno-missing-field-initializers   -Wno-strict-aliasing   -Wno-implicit-fallthrough   -Wno-deprecated-declarations   -Wconversion-null   -Wsign-promo   -pedantic   -Wunused   -Wextra   -Wall   -I/opt/local/include -I/opt/local/include/SDL2 -D_THREAD_SAFE -I/opt/local/include/freetype2 -I/opt/local/include/libpng16 -I/opt/local/include -I/opt/local/include  -g -std=c++11  -O2 -msse  -Wall   -Wextra   -Wunused   -pedantic   -Wsign-promo   -Wconversion-null   -Wno-deprecated-declarations   -Wno-implicit-fallthrough   -Wno-strict-aliasing   -Wno-missing-field-initializers   -Wno-format-zero-length   -Wno-address-of-packed-member   -Wno-int-to-void-pointer-cast   -MT cdrom_image.o -MD -MP -MF $depbase.Tpo -c -o cdrom_image.o cdrom_image.cpp &&\
	mv -f $depbase.Tpo $depbase.Po
In file included from cdrom_image.cpp:47:
In file included from ../../src/libs/decoders/mp3.cpp:34:
./../libs/decoders/dr_mp3.h:2432:27: warning: unused function 'drmp3_mix_f32' [-Wunused-function]
static DRMP3_INLINE float drmp3_mix_f32(float x, float y, float a)
                          ^
./../libs/decoders/dr_mp3.h:2436:27: warning: unused function 'drmp3_mix_f32_fast' [-Wunused-function]
static DRMP3_INLINE float drmp3_mix_f32_fast(float x, float y, float a)
                          ^
./../libs/decoders/dr_mp3.h:2448:34: warning: unused function 'drmp3_gcf_u32' [-Wunused-function]
static DRMP3_INLINE drmp3_uint32 drmp3_gcf_u32(drmp3_uint32 a, drmp3_uint32 b)
                                 ^
./../libs/decoders/dr_mp3.h:2470:28: warning: unused function 'drmp3_exp' [-Wunused-function]
static DRMP3_INLINE double drmp3_exp(double x)
                           ^
./../libs/decoders/dr_mp3.h:2476:28: warning: unused function 'drmp3_cos' [-Wunused-function]
static DRMP3_INLINE double drmp3_cos(double x)
                           ^
5 warnings generated.
	clang++ -DHAVE_CONFIG_H -I. -I../../..  -I../../../include -Wno-int-to-void-pointer-cast   -Wno-address-of-packed-member   -Wno-format-zero-length   -Wno-missing-field-initializers   -Wno-strict-aliasing   -Wno-implicit-fallthrough   -Wno-deprecated-declarations   -Wconversion-null   -Wsign-promo   -pedantic   -Wunused   -Wextra   -Wall   -I/opt/local/include -I/opt/local/include/SDL2 -D_THREAD_SAFE -I/opt/local/include/freetype2 -I/opt/local/include/libpng16 -I/opt/local/include -I/opt/local/include  -g -std=c++11  -O2 -msse  -Wall   -Wextra   -Wunused   -pedantic   -Wsign-promo   -Wconversion-null   -Wno-deprecated-declarations   -Wno-implicit-fallthrough   -Wno-strict-aliasing   -Wno-missing-field-initializers   -Wno-format-zero-length   -Wno-address-of-packed-member   -Wno-int-to-void-pointer-cast   -MT ymf262.o -MD -MP -MF $depbase.Tpo -c -o ymf262.o ymf262.cpp &&\
	mv -f $depbase.Tpo $depbase.Po
ymf262.cpp:684:20: warning: unused function 'OPL3_STATUSMASK_SET' [-Wunused-function]
static inline void OPL3_STATUSMASK_SET(OPL3 *chip,int flag)
                   ^
1 warning generated.

Environment (please complete the following information):

  • macOS
  • DOSBox-X release 0.83.3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants