Re: CVS commit: src/sys/sys
On Thu, Mar 08, 2018 at 10:25:45PM +, Christos Zoulas wrote: > In article <20180308215453.gb22...@britannica.bec.de>, > Joerg Sonnenbergerwrote: > >On Thu, Mar 08, 2018 at 03:32:33PM -0500, Christos Zoulas wrote: > >> Module Name: src > >> Committed By: christos > >> Date: Thu Mar 8 20:32:33 UTC 2018 > >> > >> Modified Files: > >>src/sys/sys: bitops.h > >> > >> Log Message: > >> PR/53081: Fix size of the shift to depend on the type of the bitmap so that > >> we get the correct width. > > > >Please don't use __typeof__. 1ull is good enough and we can depend on > >a non-stupid compiler to truncate the intermediate. > > The __typeof__ ship has already sailed: > > $ fgrep -r __typeof__ /usr/include/sys/ | wc -l >3 Of those, only the rounddown2 is non-optional. That falls into the same category even, it doesn't really hurt to widen there. > Doing a 64 bit calculation on a 32 bit platform when it is not needed > is a waste (and produces narrowing warnings). It's not a 64bit calculation if the compiler is at least trying to create sane code. The bit masking should ensure that. Joerg
Re: CVS commit: src/crypto/external/bsd/openssl/dist
In article, Christos Zoulas wrote: >In article <20180308215340.ga22...@britannica.bec.de>, >Joerg Sonnenberger wrote: >>On Wed, Mar 07, 2018 at 11:06:57AM -0500, Christos Zoulas wrote: >>> Module Name:src >>> Committed By: christos >>> Date: Wed Mar 7 16:06:57 UTC 2018 >>> >>> Modified Files: >>> src/crypto/external/bsd/openssl/dist: e_os.h >>> >>> Log Message: >>> HACK around aarch64 having "long long" "__int64_t" >> >>Please, just check __STDC_VERSION__ and use the real one for C99 and >>later. No need for any such hacks. > >Will fix! Just trying to get everything to compile first. Can't do it without making a lot of diffs. There is no C99 with the size and without the format specifier: e.g. #define PRId64 "ld"/* int64_t */ Where OpenSSL wants: #define BIO_PRI64 "l" christos
Re: CVS commit: src/sys/sys
In article <20180308215453.gb22...@britannica.bec.de>, Joerg Sonnenbergerwrote: >On Thu, Mar 08, 2018 at 03:32:33PM -0500, Christos Zoulas wrote: >> Module Name: src >> Committed By:christos >> Date:Thu Mar 8 20:32:33 UTC 2018 >> >> Modified Files: >> src/sys/sys: bitops.h >> >> Log Message: >> PR/53081: Fix size of the shift to depend on the type of the bitmap so that >> we get the correct width. > >Please don't use __typeof__. 1ull is good enough and we can depend on >a non-stupid compiler to truncate the intermediate. The __typeof__ ship has already sailed: $ fgrep -r __typeof__ /usr/include/sys/ | wc -l 3 Not counting all the c++ header uses... Doing a 64 bit calculation on a 32 bit platform when it is not needed is a waste (and produces narrowing warnings). christos
Re: CVS commit: src/sys/sys
On Thu, Mar 08, 2018 at 03:32:33PM -0500, Christos Zoulas wrote: > Module Name: src > Committed By: christos > Date: Thu Mar 8 20:32:33 UTC 2018 > > Modified Files: > src/sys/sys: bitops.h > > Log Message: > PR/53081: Fix size of the shift to depend on the type of the bitmap so that > we get the correct width. Please don't use __typeof__. 1ull is good enough and we can depend on a non-stupid compiler to truncate the intermediate. Joerg
Re: CVS commit: src/crypto/external/bsd/openssl/dist
On Wed, Mar 07, 2018 at 11:06:57AM -0500, Christos Zoulas wrote: > Module Name: src > Committed By: christos > Date: Wed Mar 7 16:06:57 UTC 2018 > > Modified Files: > src/crypto/external/bsd/openssl/dist: e_os.h > > Log Message: > HACK around aarch64 having "long long" "__int64_t" Please, just check __STDC_VERSION__ and use the real one for C99 and later. No need for any such hacks. Joerg