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

miscompilation when using add_main_option_entry #1

Open
bstarynk opened this issue Feb 19, 2024 · 1 comment
Open

miscompilation when using add_main_option_entry #1

bstarynk opened this issue Feb 19, 2024 · 1 comment

Comments

@bstarynk
Copy link
Member

Consider

#if 0 && badcode

If you change the #if 0 && badcode into a #if 1 that does not compile anymore:

mainrps_gtk.cc:85:2: warning: #warning help needed here to parse program arguments [-Wcpp]
   85 | #warning help needed here to parse program arguments
      |  ^~~~~~~
mainrps_gtk.cc: In function ‘int main(int, char**)’:
mainrps_gtk.cc:87:55: error: ‘OPTION_TYPE_BOOL’ is not a member of ‘Gio::Application’
   87 |   gtkrps_app->add_main_option_entry(Gio::Application::OPTION_TYPE_BOOL,   "version",    'V',
      |                                                       ^~~~~~~~~~~~~~~~
mainrps_gtk.cc:89:55: error: ‘OPTION_TYPE_STRING’ is not a member of ‘Gio::Application’
   89 |   gtkrps_app->add_main_option_entry(Gio::Application::OPTION_TYPE_STRING,   "fifo-prefix",    'F',
      |                                                       ^~~~~~~~~~~~~~~~~~
make: *** [<builtin>: mainrps_gtk.o] Error 1
@bstarynk
Copy link
Member Author

The entire compilation command is obtained by make on a Debian/Trixie/x86-64 desktop

g++ -fPIE -Wall -Wextra -O1  -I/usr/include/gtkmm-4.0 -I/usr/lib/x86_64-linux-gnu/gtkmm-4.0/include \
 -I/usr/include /giomm-2.68 -I/usr/lib/x86_64-linux-gnu/giomm-2.68/include -I/usr/include/glib-2.0 \
 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/libmount -I/usr/include/blkid \
 -I/usr/include/glibmm-2.68 -I/usr/lib/x86_64-linux-gnu/glibmm-2.68/include -I/usr/include/sigc++-3.0 \
 -I/usr/lib/x86_64-linux-gnu/sigc++-3.0/include -I/usr/include/gtk-4.0 -I/usr/include/pango-1.0 \
 -I/usr/include/harfbuzz -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/fribidi \
  -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/x86_64-linux-gnu \
 -I/usr/include/webp -I/usr/include/graphene-1.0 -I/usr/lib/x86_64-linux-gnu/graphene-1.0/include \
  -I/usr/include/cairomm-1.16 -I/usr/lib/x86_64-linux-gnu/cairomm-1.16/include \
 -I/usr/include/pangomm-2.48 -I/usr/lib/x86_64-linux-gnu/pangomm-2.48/include\
  -I/usr/include/gtk-4.0/unix-print -mfpmath=sse -msse -msse2 -pthread -I/usr/include/jsoncpp  \
 -DGIT_ID=\"7198ca6df1b7c91689af56d370e3783ee76a00b1+\" -DSHORTGIT_ID=\"7198ca6df1b7+\" \
 -DGTKRPS_HOST=\"rimski.lesours\" -DGTKRPS_ARCH=\"x86_64\" -DGTKRPS_OPERSYS=\"GNU_Linux\"  \
  -c -o mainrps_gtk.o mainrps_gtk.cc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant