lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190305201129.GH13380@bombadil.infradead.org>
Date:   Tue, 5 Mar 2019 12:11:29 -0800
From:   Matthew Wilcox <willy@...radead.org>
To:     Joe Perches <joe@...ches.com>
Cc:     Nick Desaulniers <ndesaulniers@...gle.com>,
        Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
        Louis Taylor <louis@...gniz.eu>,
        Jonathan Corbet <corbet@....net>, pmladek@...e.com,
        geert+renesas@...der.be, linux-doc@...r.kernel.org,
        LKML <linux-kernel@...r.kernel.org>,
        clang-built-linux@...glegroups.com,
        Jon Flatley <jflat@...omium.org>
Subject: Re: [PATCH] docs: add extra integer types to printk-formats

On Tue, Mar 05, 2019 at 12:07:25PM -0800, Matthew Wilcox wrote:
> On Tue, Mar 05, 2019 at 11:59:30AM -0800, Joe Perches wrote:
> > Many of the -Wformat warnings are bogus too.
> > 
> > There's nothing wrong with using %x for a unsigned int
> > of less than long size. (u8/u16)
> 
> I believe you to be incorrect.

No, you're right, I got tangled up in the spec language and stopped
reading too soon.

> 6.5.2.2 Function calls
> 
> 7 If the expression that denotes the called function has a type that does
>   include a prototype, the arguments are implicitly converted, as if by
>   assignment, to the types of the corresponding parameters, taking the
>   type of each parameter to be the unqualified version of its declared
>   type. The ellipsis notation in a function prototype declarator causes
>   argument type conversion to stop after the last declared parameter. The
>   default argument promotions are performed on trailing arguments.

... the default argument promotions performed on the trailing arguments
promote short/char to int.  So you were right.

> I could define a calling convention for my CPU which says to pack u8s
> and u16s as tightly as possible in registers (or on the stack), rather
> than the prevailing calling convention of having each argument take up
> at least one register-sized slot.

... and that is just wrong; it's not allowed.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ