From 1966b5db6ab187e0f4b06eaf4c0bb8dcf9c4e217 Mon Sep 17 00:00:00 2001 From: William Pitcock Date: Sat, 6 Jan 2018 01:32:27 +0000 Subject: main - fix incorrect type deduction with some gcc versions GCC 6.4 on Alpine incorrectly deduces the type returned from ::std::strchr(const char *, char) as 'char *', instead of 'const char *', which causes the wrong constructor to be used. Closes #32. --- src/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/main.cpp b/src/main.cpp index 36fa106e..b23bb9e9 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -773,7 +773,7 @@ ProgramParams::ProgramParams(int argc, char *argv[]) exit(1); } const char* desc = argv[++i]; - auto* pos = ::std::strchr(desc, '='); + const char* pos = ::std::strchr(desc, '='); if( pos == nullptr ) { ::std::cerr << "--extern takes an argument of the format name=path" << ::std::endl; exit(1); -- cgit v1.2.3