GNOME Bugzilla – Bug 588989
optional flag in Glib::OptionEntry cause crash is the arg is omitted
Last modified: 2009-07-19 14:02:06 UTC
If I set entry.set_flags(Glib::OptionEntry::FLAG_OPTIONAL_ARG); to a Glib::OptionEntry, the program crashes when I really omit the argument. Attached is a sample code. ./optiontest --search crash ./optiontest --search=text works
Created attachment 138714 [details] test case
Sorry, that's actually a glib crash. It seems that this flag only applies to G_OPTION_ARG_CALLBACK arg types. The fact that Glibmm does not seem to allow these is a different story. Not a Glibmm bug.
*** Bug 588990 has been marked as a duplicate of this bug. ***
I guess that glib should at least show a critical warning before crashing. If it doesn't, please file a glib bug. Should we prevent the use of the wrong flags with the wrong type of arguments in glibmm? http://library.gnome.org/devel/glib/unstable/glib-Commandline-option-parser.html#GOptionFlags
It does an then crash. It is definitely not Glibmm.