On Mon, Jul 07, 2025 at 05:02:21PM +0200, Scott Kostyshak wrote: > On Sat, Jul 05, 2025 at 10:18:06PM +0200, Scott Kostyshak wrote: > > On Sat, Jul 05, 2025 at 09:35:58PM +0200, Kornel Benko wrote: > > > Am Sat, 5 Jul 2025 21:18:52 +0200 > > > schrieb Kornel Benko <[email protected]>: > > > > > > > Am Sat, 5 Jul 2025 20:59:42 +0200 > > > > schrieb Scott Kostyshak <[email protected]>: > > > > > > > > > On Sat, Jul 05, 2025 at 08:14:49PM +0200, Kornel Benko wrote: > > > > > > Am Sat, 05 Jul 2025 18:05:27 +0000 > > > > > > schrieb Scott Kostyshak <[email protected]>: > > > > > > > > > > > > > commit cd5fb84098f46738a45699aeb1491b52282e3c2d > > > > > > > Author: Scott Kostyshak <[email protected]> > > > > > > > Date: Sat Jul 5 20:04:28 2025 +0200 > > > > > > > > > > > > > > Fix the last remaining -Wmissing-noreturn > > > > > > > > > > > > > > lyxbreaker() calls LBUFERR() which calls doBufErr() which was > > > > > > > previously > > > > > > > marked as [[noreturn] at 37b9655f. > > > > > > > --- > > > > > > > src/CoordCache.h | 2 +- > > > > > > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > > > > > > > > > > > diff --git a/src/CoordCache.h b/src/CoordCache.h > > > > > > > index 8893aebe48..c732e6f042 100644 > > > > > > > --- a/src/CoordCache.h > > > > > > > +++ b/src/CoordCache.h > > > > > > > @@ -38,7 +38,7 @@ class MathData; > > > > > > > #define ASSERT_HAS_POS(thing, hint) > > > > > > > #endif > > > > > > > > > > > > > > -void lyxbreaker(void const * data, const char * hint, int size); > > > > > > > +[[noreturn]] void lyxbreaker(void const * data, const char * > > > > > > > hint, int size); > > > > > > > > > > > > > > struct Geometry { > > > > > > > Point pos = {-10000, -10000 }; > > > > > > > > > > > > /usr2/src/lyx/lyx-git/src/LyX.cpp:270:1: error: function declared > > > > > > 'noreturn' should > > > > > > not return [-Werror,-Winvalid-noreturn] 270 | } > > > > > > > > > > Dang. What is your compiler and compiler version number? > > > > > > > > > > I tested on GCC 13.3.0 and Clang 18.1.3. > > > > > > > > > > I have access to other versions so I'll test those when I can. > > > > > > > > > > Scott > > > > > > > > clang18.1.3 > > > > -fno-strict-aliasing -O3 -DNDEBUG -std=c++20 -Wall -Wextra > > > > -Wno-deprecated-copy -Werror > > > > -pedantic -Wundef -Wno-nested-anon-types -Wno-deprecated-declarations > > > > > > > > Kornel > > > > > > This 'cures' it > > > diff --git a/src/LyX.cpp b/src/LyX.cpp > > > index 8c467f5e6a..c847de0d3e 100644 > > > --- a/src/LyX.cpp > > > +++ b/src/LyX.cpp > > > @@ -263,12 +263,11 @@ void lyx_exit(int exit_code) > > > #endif > > > > > > // In release mode, try to exit gracefully. > > > if (theApp()) > > > theApp()->exit(exit_code); > > > - else > > > - exit(exit_code); > > > + exit(exit_code); > > > > Interesting! Thanks for figuring that out. It makes sense from a cursor > > point of view, but I also am hesitant to touch this code. > > > > I suggest we wait to see if anyone else gives a +1 to your patch. > > Otherwise I will revert my change to that function and put this warning > > category on hold. > > I can reproduce the warning you get if I set -DNDEBUG. I wonder if > what's going on is that -DNDEBUG turns off some underlying assertions so > that the function does actually return? > > Knowing that, does that tell us whether your patch makes sense to > commit? I still don't know. > > Either way, it seems like we should either both set -DNDEBUG or both not > set it. > > From what I understand, -DNDEBUG is more of a release flag. So I wonder > if it makes sense for you to remove it from your set of development > flags looking at warnings. That said, I don't know what I'm talking > about so I could have misunderstood.
Kornel, I can no longer reproduce. For example, in my make log I set both -Wmissing-noreturn -DNDEBUG and all seems to go well. Further, I removed setting "no-missing-noreturn" in CMakeLists. Just to show that the flags are used, here's output from my make log: cd /home/scott/lyxbuilds/master-master/CMakeBuild/src/insets && /usr/lib/ccache/clang++ -DQT_CORE_LIB -DQT_GUI_LIB -I/home/scott/lyxbuilds/master-master/CMakeBuild -I/home/scott/lyxbuilds/master-master/repo/src -I/usr/include/enchant-2 -I/usr/include/hunspell -I/home/scott/lyxbuilds/master-master/repo/3rdparty/nod -I/home/scott/lyxbuilds/master-master/repo/src/insets -isystem /usr/include/x86_64-linux-gnu/qt6/QtGui -isystem /usr/include/x86_64-linux-gnu/qt6 -isystem /usr/include/x86_64-linux-gnu/qt6/QtCore -isystem /usr/lib/x86_64-linux-gnu/qt6/mkspecs/linux-g++ -DENABLE_ASSERTIONS=1 -fno-strict-aliasing -O0 -g3 -std=c++20 -Wall -Wextra -Wno-deprecated-copy -Werror -pedantic -Wextra-semi -Wmissing-include-dirs -ferror-limit=1 -Wheader-hygiene -Wno-pre-c++17-compat -Wno-c++98-compat -Wno-implicit-int-float-conversion -Wno-unreachable-code-return -Wstring-conversion -Wno-reserved-macro-identifier -Wno-documentation-html -Wused-but-marked-unused -Wdeprecated-copy-with-dtor -Wdelete-non-virtual-dtor -Wno-float-equal -Wcast-qual -Wno-padded -Wno-shadow -Wno-effc++ -Wno-non-virtual-dtor -Wno-aggregate-return -Wcast-align -Wformat=2 -Wpointer-arith -Wsequence-point -Wswitch -Wunused-but-set-parameter -Wwrite-strings -Wredundant-decls -Wundef -Wno-implicit-fallthrough -Wdouble-promotion -Wmisleading-indentation -Wno-sign-conversion -Wno-conversion -Woverloaded-virtual -Wunused -Wno-old-style-cast -Wunused-macros -Wmissing-noreturn -DNDEBUG -Wno-nested-anon-types -Wno-deprecated-declarations -Wno-shadow -MD -MT src/insets/CMakeFiles/insets.dir/InsetBibtex.cpp.o -MF CMakeFiles/insets.dir/InsetBibtex.cpp.o.d -o CMakeFiles/insets.dir/InsetBibtex.cpp.o -c /home/scott/lyxbuilds/master-master/repo/src/insets/InsetBibtex.cpp Can you still reproduce the error? If yes, can you give me your build commands to see if I can reproduce? Scott
signature.asc
Description: PGP signature
-- lyx-devel mailing list [email protected] https://lists.lyx.org/mailman/listinfo/lyx-devel
