Hi, Ady wrote:> IMHO, the adequate way to solve the problem is finding why vesamenu.c32 > triggers a problem when it is compiled with gcc v.5+.I agree. Currently i am riddling why copy_sysappend_string() should be invoked at all. txt/syslinux.cfg.txt obviously describes the .cfg interface of readconfig.c:record() as "SYSAPPEND" and its flag values. Rawhide-Live-Xfce-628.iso from http://goo.gl/Gm4ffO has no such directive. So probably it's about the change in core/sysappend.c function copy_and_mangle() which might be called underneath execute() of com32/elflink/ldlinux/execute.c. But this still does not explain why gcc versions are decisive for success. For that we'd need to find some code of undefined behavior, where the compiler would be free to produce different outcome. hpa wrote:> I think I see the problem. "char" should be "unsigned char"...Well, "char" zapps the characters above (unsigned char) 127. But why does the gcc version have an influence ? (C does not specify the signedness of char, but i never saw a compiler which represented char other than as signed char.) Have a nice day :) Thomas
On 07/02/2015 12:06 PM, Thomas Schmitt via Syslinux wrote:> > Well, "char" zapps the characters above (unsigned char) 127. > But why does the gcc version have an influence ? > (C does not specify the signedness of char, but i never saw > a compiler which represented char other than as signed char.) >... on x86. It is actually ABI specific. On PowerPC (I think) "unsigned char" is the default. gcc does have an -funsigned-char option. -hpa
Hi, hpa wrote:> On PowerPC (I think) "unsigned char" is the default.In any case it seems a good idea to interpret the character more explicitely. To my experience, one signdness change causes a little tree of consequential signedness changes or questionable cast operations. How about the following instead ? if ((c >= 0 && c <= ' ') || c == '\x7f') { Besides code improvement there is the riddle of how gcc 5 can spoil the result.> gcc does have an -funsigned-char option.So question to poma: Can it be that the tested installation of gcc 5 uses this option by default ? I read through the mailing list archive but could not find a mail where you tell the compiler version which produces working binaries. Additionally to the different signedness of char, this theory would also need (unsigned) characters between 128 and 255 in the SYSAPPEND variables. Is this plausible ? Have a nice day :) Thomas