Bug 9640

Summary: lms8 fails with gcc6
Product: [Build System, Metadata & Runtime] BSPs Reporter: Ross Burton <ross.burton>
Component: bsps-meta-intelAssignee: Saul Wold <sgw>
Status: RESOLVED FIXED QA Contact: David Rodriguez <david.israelx.rodriguez.castellanos>
Severity: normal    
Priority: High CC: jose.perez.carranza
Version: 2.2   
Target Milestone: 2.2 M1   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)

Description Ross Burton 2016-05-16 15:21:23 UTC
If gcc 6 is used (GCCVERSION = "6.1%") then lms8 fails to build:

make[2]: Entering directory '/data/poky-master/tmp-glibc/work/corei7-64-poky-linux/lms8/8.0.0-7-r0/build/src'
x86_64-poky-linux-g++ -m64 -march=corei7 -mtune=corei7 -mfpmath=sse -msse4.2 --sysroot=/data/poky-master/tmp-glibc/sysroots/intel-corei7-64 -DHAVE_CONFIG_H -I. -I../../lms-8.0.0-7/src -I.. -I../../lms-8.0.0-7/src -I../../lms-8.0.0-7/src/SyncLib/Include -I../../lms-8.0.0-7/src/mei -I../../lms-8.0.0-7/src/tools  -D_LINUX  -O2 -pipe -g -feliminate-unused-debug-types -fdebug-prefix-map=/data/poky-master/tmp-glibc/work/corei7-64-poky-linux/lms8/8.0.0-7-r0=/usr/src/debug/lms8/8.0.0-7-r0 -fdebug-prefix-map=/data/poky-master/tmp-glibc/sysroots/x86_64-linux= -fdebug-prefix-map=/data/poky-master/tmp-glibc/sysroots/intel-corei7-64=  -fvisibility-inlines-hidden -Wall -c -o Protocol.o ../../lms-8.0.0-7/src/Protocol.cpp
In file included from ../../lms-8.0.0-7/src/Protocol.h:40:0,
                 from ../../lms-8.0.0-7/src/Protocol.cpp:52:
../../lms-8.0.0-7/src/LMEConnection.h: In constructor 'LMEUserAuthRequestMessage::LMEUserAuthRequestMessage(std::__cxx11::string, std::__cxx11::string, std::__cxx11::string, AuthMethodData*)':
../../lms-8.0.0-7/src/LMEConnection.h:137:2: warning: 'LMEUserAuthRequestMessage::ServiceName' is initialized with itself [-Winit-self]
  LMEUserAuthRequestMessage(std::string username = "",
  ^~~~~~~~~~~~~~~~~~~~~~~~~
../../lms-8.0.0-7/src/Protocol.cpp: In member function 'void Protocol::_closePortForwardRequest(PortForwardRequest*)':
../../lms-8.0.0-7/src/Protocol.cpp:629:7: warning: variable 'found' set but not used [-Wunused-but-set-variable]
  bool found = false;
       ^~~~~
../../lms-8.0.0-7/src/Protocol.cpp: In member function 'int Protocol::_handleFQDNChange(const char*)':
../../lms-8.0.0-7/src/Protocol.cpp:1439:176: error: unable to find string literal operator 'operator""a' with 'const char [43]', 'long unsigned int' arguments
 #define LMS_LINE_SCAN_FORMAT_IPV4 "127.0.0.1 %" lmsstr(FQDN_MAX_SIZE) "s %" lmsstr(FQDN_MAX_SIZE) "s " LMS_LINE_SIG_FIRST_WORDS("IPv4") "%" lmsstr(LMS_LINE_SIG_LAST_WORD_LEN) "c"
                                                                                                                                                                                ^
../../lms-8.0.0-7/src/Protocol.cpp:1479:26: note: in expansion of macro 'LMS_LINE_SCAN_FORMAT_IPV4'
       (3 == sscanf(line, LMS_LINE_SCAN_FORMAT_IPV4, oldFqdn, host, tmpsige))
                          ^~~~~~~~~~~~~~~~~~~~~~~~~
../../lms-8.0.0-7/src/Protocol.cpp:1440:176: error: unable to find string literal operator 'operator""a' with 'const char [43]', 'long unsigned int' arguments
 #define LMS_LINE_SCAN_FORMAT_IPV6 "::1       %" lmsstr(FQDN_MAX_SIZE) "s %" lmsstr(FQDN_MAX_SIZE) "s " LMS_LINE_SIG_FIRST_WORDS("IPv6") "%" lmsstr(LMS_LINE_SIG_LAST_WORD_LEN) "c"
                                                                                                                                                                                ^
../../lms-8.0.0-7/src/Protocol.cpp:1493:26: note: in expansion of macro 'LMS_LINE_SCAN_FORMAT_IPV6'
       (3 == sscanf(line, LMS_LINE_SCAN_FORMAT_IPV6, oldFqdn, host, tmpsige))
                          ^~~~~~~~~~~~~~~~~~~~~~~~~
../../lms-8.0.0-7/src/Protocol.cpp:1541:38: error: unable to find string literal operator 'operator""a' with 'const char [45]', 'long unsigned int' arguments
    fprintf(ofp, LMS_LINE_FORMAT_IPV4 "\n", fqdn, host);
                                      ^~~~
../../lms-8.0.0-7/src/Protocol.cpp:1543:38: error: unable to find string literal operator 'operator""a' with 'const char [45]', 'long unsigned int' arguments
    fprintf(ofp, LMS_LINE_FORMAT_IPV6 "\n", fqdn, host);
                                      ^~~~
Makefile:519: recipe for target 'Protocol.o' failed

I think this is related to gcc6 having more C++11 bits enabled by default, https://gcc.gnu.org/gcc-4.7/porting_to.html has a section on "User-defined literals and whitespace" which might be relevant.