Re: https://gcc.gnu.org/gcc-7/changes.html

2017-07-11 Thread Jonny Grant
On 11/07/17 09:56, Jonathan Wakely wrote: On 11 July 2017 at 17:51, Jonny Grant wrote: Hello https://gcc.gnu.org/gcc-7/changes.html snprintf (d, sizeof d, "%#02x", x & 0xff); ^^ Should be: sizeof(d) ? "The sizeof operator yields the size (in bytes) of its operand, which

Re: https://gcc.gnu.org/gcc-7/changes.html

2017-07-11 Thread Jonathan Wakely
On 11 July 2017 at 17:51, Jonny Grant wrote: > Hello > https://gcc.gnu.org/gcc-7/changes.html > > snprintf (d, sizeof d, "%#02x", x & 0xff); > >^^ > Should be: sizeof(d) ? "The sizeof operator yields the size (in bytes) of its operand, which may be an expression or the parenthes

Re: https://gcc.gnu.org/gcc-7/changes.html

2017-07-11 Thread Marek Polacek
On Tue, Jul 11, 2017 at 09:51:19AM -0700, Jonny Grant wrote: > Hello > https://gcc.gnu.org/gcc-7/changes.html > > snprintf (d, sizeof d, "%#02x", x & 0xff); > >^^ > Should be: sizeof(d) ? Why? Both are correct. Marek