From: Dodji Seketeli <dodji@redhat.com>
To: Prathamesh Kulkarni <bilbotheelffriend@gmail.com>
Cc: gcc <gcc@gcc.gnu.org>
Subject: Re: -Wformat-security warnings generated in gcc build
Date: Thu, 23 Jan 2014 15:39:00 -0000 [thread overview]
Message-ID: <874n4uagv0.fsf@redhat.com> (raw)
In-Reply-To: <CAJXstsBrMyJ66oFM8RjRNHUyC5TZVgVGD=xkRAcVc9FzQ7PKFA@mail.gmail.com> (Prathamesh Kulkarni's message of "Thu, 23 Jan 2014 18:46:38 +0530")
Prathamesh Kulkarni <bilbotheelffriend@gmail.com> writes:
>
> Shall it be correct then to replace calls to error() and friends,
> taking only format string with no-argument specifiers
> to error_at_no_args() ? (similarly we shall need warning_at_no_args,
> pedwarn_no_args, etc.)
I would guess so, yes.
>>
>> Also, you'd need to modify cp/error.c:cp_printer in a similar way, to
>> issue an internal_error each time we try to access a null test->args_ptr.
>
> Shall check for text->args_ptr be required in each case label of
> argument specifier in pp_format()
> and client-specific functions like cp_printer() ?
Yes, I think so. Maybe you can make that a bit more maintainable by
creating a macro like those used to access text->args_ptr in cp_printer,
e.g:
#define next_int va_arg (*text->args_ptr, int)
In that macro, make the check for text->args_ptr before accessing it,
and then use that macro to access text->args_ptr through the function.
--
Dodji
next prev parent reply other threads:[~2014-01-23 14:54 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-21 16:03 Prathamesh Kulkarni
2014-01-21 17:50 ` Jakub Jelinek
2014-01-21 17:58 ` Joseph S. Myers
2014-01-21 20:19 ` Florian Weimer
2014-01-22 15:48 ` Prathamesh Kulkarni
2014-01-22 18:05 ` Joseph S. Myers
2014-01-23 11:43 ` Dodji Seketeli
2014-01-23 13:16 ` Trevor Saunders
2014-01-23 14:54 ` Prathamesh Kulkarni
2014-01-23 15:39 ` Dodji Seketeli [this message]
2014-01-23 15:55 ` Prathamesh Kulkarni
2014-01-24 16:19 ` Prathamesh Kulkarni
2014-01-26 16:12 ` Prathamesh Kulkarni
2014-02-01 18:00 ` Prathamesh Kulkarni
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=874n4uagv0.fsf@redhat.com \
--to=dodji@redhat.com \
--cc=bilbotheelffriend@gmail.com \
--cc=gcc@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).