[syslinux] boot... round 2

poma pomidorabelisima at gmail.com
Thu Jul 2 21:50:27 PDT 2015


On 02.07.2015 23:12, Thomas Schmitt wrote:
> 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') {
> 


- "unsigned char c;" does not solve the problem

- "c >= 0 && c <= ' '" solves the problem for the current git

--- a/com32/menu/readconfig.c
+++ b/com32/menu/readconfig.c
@@ -299,7 +299,7 @@
     char c;
 
     while ((c = *src++)) {
-	if (c <= ' ' || c == '\x7f') {
+	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 ?


See for yourself is it so or not:

$ rpm -qf /usr/lib/rpm/rpmrc
rpm-4.12.0.1-17.fc23.x86_64

$ grep optflags /usr/lib/rpm/rpmrc | grep 86
optflags: fat -O2 -g -arch i386 -arch ppc
optflags: i386 -O2 -g -march=i386 -mtune=i686
optflags: i486 -O2 -g -march=i486
optflags: i586 -O2 -g -march=i586
optflags: i686 -O2 -g -march=i686
optflags: x86_64 -O2 -g


$ rpm -qf /usr/lib/rpm/redhat/rpmrc
redhat-rpm-config-33-2.fc23.noarch

$ grep optflags /usr/lib/rpm/redhat/rpmrc | grep 86
optflags: i386 %{__global_cflags} -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables
optflags: i486 %{__global_cflags} -m32 -march=i486 -fasynchronous-unwind-tables
optflags: i586 %{__global_cflags} -m32 -march=i586 -mtune=generic -fasynchronous-unwind-tables
optflags: i686 %{__global_cflags} -m32 -march=i686 -mtune=atom -fasynchronous-unwind-tables
optflags: x86_64 %{__global_cflags} -m64 -mtune=generic


$ grep '  RPM_OPT_FLAGS\|  RPM_PACKAGE_NAME' /var/tmp/rpm-tmp.XNVZuk
  RPM_OPT_FLAGS="-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic"
  RPM_PACKAGE_NAME="syslinux"


> I read through the mailing list archive but could not
> find a mail where you tell the compiler version which
> produces working binaries.


I wrote it in this thread already, here I will repeat a reference for you:
https://bugzilla.redhat.com/show_bug.cgi?id=1234653#c9


> 
> 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
> 



More information about the Syslinux mailing list