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: <b8bf37780911011500o741bef51sf8a057e2cedcf22c@mail.gmail.com>
Date:	Sun, 1 Nov 2009 21:00:48 -0200
From:	André Goddard Rosa <andre.goddard@...il.com>
To:	Frederic Weisbecker <fweisbec@...il.com>
Cc:	laijs@...fujitsu.com, mingo@...e.hu, davem@...emloft.net,
	akpm@...ux-foundation.org, harvey.harrison@...il.com,
	linux list <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] vsprintf: reduce code size, clean up

Hi, Frederic!

On Sun, Nov 1, 2009 at 8:45 PM, Frederic Weisbecker <fweisbec@...il.com> wrote:
> On Sun, Nov 01, 2009 at 03:01:40PM -0200, André Goddard Rosa wrote:
>> +static char null[] = "(null)";
>> +
>
>
> This should be static const.
> Also, may be chose a better name, as "null" is too much
> generic and somehow collide with NULL.
>
> null_str ?
>

If I make it a "static const" it's necessary to cast it in two places
to "char *" and code size goes up

lib/vsprintf.c: In function ‘string’:
lib/vsprintf.c:556: warning: assignment discards qualifiers from
pointer target type
lib/vsprintf.c: In function ‘pointer’:
lib/vsprintf.c:828: warning: passing argument 3 of ‘string’ discards
qualifiers from pointer target type
lib/vsprintf.c:551: note: expected ‘char *’ but argument is of type
‘const char *’

   text    data     bss     dec     hex filename
 15383       7       8   15398    3c26 lib/vsprintf.o-static-before
 15431       0       8   15439    3c4f lib/vsprintf.o-static-const-after

as it moves the variable from data section to code section. Is this
the preferred method?


Thanks for reviewing! I'll fix the other points per your suggestions
and post back.

With regards,
André
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ