Re: Kernel compilation fail with clang.

2017-08-03 Thread Olivier Antoine
Thanks Jonathan, that was it. For unknown reason that file was not in sync.

On Thu, Aug 3, 2017 at 2:55 AM, Jonathan Gray  wrote:

> On Wed, Aug 02, 2017 at 09:06:00PM +0200, Olivier Antoine wrote:
> > Hi,
> >
> > I may have missed something but I'm unable to compile the kernel since (I
> > think) the switch to clang on AMD64.
> >
> > I have upgraded to the latest snapshot, updated my /sys tree
> >
> > $ cd /sys/arch/$(machine)/compile/GENERIC.MP
> > $ doas make obj
> > $ make config
> > $ make
> >
> > Then the compilation fail with this message:
> >
> > /sys/netinet/igmp.c:140:22: error: implicit conversion from 'int' to
> > 'int8_t'
> >   (aka 'signed char') changes value from 148 to -108
> >   [-Werror,-Wconstant-conversion]
> > ra->ipopt_list[0] = IPOPT_RA;
> >   ~ ^~~~
> > /sys/netinet/ip.h:153:19: note: expanded from macro 'IPOPT_RA'
> > #define IPOPT_RA148 /* router alert */
> > ^~~
> > 1 error generated.
> > *** Error 1 in target 'igmp.o'
> > *** Error 1 in /sys/arch/amd64/compile/GENERIC.MP (Makefile:961
> 'igmp.o')
> >
> > Is there something wrong with my setup?
> > If my reading of the code is good, the error seems legitimate.
>
> Something is wrong with your checkout.  /sys/arch/amd64/conf/Makefile.
> amd64
> has -Wno-constant-conversion.  make config creates
> /sys/arch/amd64/compile/GENERIC.MP/obj/Makefile based on that.
>


Kernel compilation fail with clang.

2017-08-02 Thread Olivier Antoine
Hi,

I may have missed something but I'm unable to compile the kernel since (I
think) the switch to clang on AMD64.

I have upgraded to the latest snapshot, updated my /sys tree

$ cd /sys/arch/$(machine)/compile/GENERIC.MP
$ doas make obj
$ make config
$ make

Then the compilation fail with this message:

/sys/netinet/igmp.c:140:22: error: implicit conversion from 'int' to
'int8_t'
  (aka 'signed char') changes value from 148 to -108
  [-Werror,-Wconstant-conversion]
ra->ipopt_list[0] = IPOPT_RA;
  ~ ^~~~
/sys/netinet/ip.h:153:19: note: expanded from macro 'IPOPT_RA'
#define IPOPT_RA148 /* router alert */
^~~
1 error generated.
*** Error 1 in target 'igmp.o'
*** Error 1 in /sys/arch/amd64/compile/GENERIC.MP (Makefile:961 'igmp.o')

Is there something wrong with my setup?
If my reading of the code is good, the error seems legitimate.


Standard conformance of strtol(3)

2017-07-05 Thread Olivier Antoine
Hi all,

Recently a bug has been identified in Tor:

https://trac.torproject.org/projects/tor/ticket/22789

As comments were made, questions were raised about the use of strtol(3),
the different interpretations of the standard and their implementation.

To summarize, the question revolves around the processing of strings in
base=16 and with the optional prefix '0x'.

l = strtol ("0xquux", & rest, 16);

Produce
l=0 rest=0xquux on OpenBSD
l=0 rest=xquux on Linux

Do specialists of the standard or developers have an opinion on this point
of detail?
Is there a defined behavior?

-- 
Olivier