adrian-thurston / colm

The Colm Programming Language
MIT License
167 stars 32 forks source link

dangling-gsl warning with Colm 0.14.6 and Apple Clang #127

Closed evanmiller closed 3 years ago

evanmiller commented 3 years ago
g++ -DHAVE_CONFIG_H -I. -I../../src  -I../../src/include   -Wall -g -MT rlparse-load.o -MD -MP -MF .deps/rlparse-load.Tpo -c -o rlparse-load.o `test -f 'load.cc' || echo './'`load.cc
load.cc:2248:27: warning: object backing the pointer will be destroyed at the end of the full-expression [-Wdangling-gsl]
                const char *depthText = Spec.Depth().text().c_str();
                                        ^~~~~~~~~~~~~~~~~~~
load.cc:2254:27: warning: object backing the pointer will be destroyed at the end of the full-expression [-Wdangling-gsl]
                const char *groupText = Spec.Group().text().c_str();
                                        ^~~~~~~~~~~~~~~~~~~
2 warnings generated.

Compiler:

$ g++ --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/4.2.1
Apple clang version 12.0.0 (clang-1200.0.32.28)
Target: x86_64-apple-darwin20.2.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
telans commented 3 years ago

ditto

clang version 11.0.1
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/lib/llvm/11/bin
Selected GCC installation: /usr/lib/gcc/x86_64-pc-linux-gnu/10.2.0