unofficial mirror of libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Stefan Liebler <stli@linux.ibm.com>
To: Florian Weimer <fweimer@redhat.com>
Cc: GNU C Library <libc-alpha@sourceware.org>
Subject: Re: [PATCH] Fix build warnings in locale/programs/ld-ctype.c
Date: Tue, 25 Jun 2019 15:49:30 +0200	[thread overview]
Message-ID: <6f5b060a-8260-9026-e34f-fedfc8e454fa@linux.ibm.com> (raw)
In-Reply-To: <87h88d239e.fsf@oldenburg2.str.redhat.com>

On 6/25/19 3:39 PM, Florian Weimer wrote:
> * Stefan Liebler:
> 
>> On 6/25/19 3:23 PM, Florian Weimer wrote:
>>> * Stefan Liebler:
>>>
>>>> diff --git a/locale/programs/ld-ctype.c b/locale/programs/ld-ctype.c
>>>> index e6105928da..cfc9c43fd5 100644
>>>> --- a/locale/programs/ld-ctype.c
>>>> +++ b/locale/programs/ld-ctype.c
>>>> @@ -1396,7 +1396,8 @@ charclass_symbolic_ellipsis (struct linereader *ldfile,
>>>>    		   (int) (now->val.str.lenmb - (cp - last_str)),
>>>>    		   from);
>>>>    -	  get_character (now, charmap, repertoire, &seq, &wch);
>>>> +	  if (get_character (now, charmap, repertoire, &seq, &wch))
>>>> +	    goto invalid_range;
>>>
>>> Maybe write:
>>>
>>>     if (get_character (now, charmap, repertoire, &seq, &wch) != 0)
>>>
>>> to match the other function calls?
>> Okay. That's no problem. If no one opposes, I'll commit the patch
>> tomorrow with "!= 0".
>>
>> Shall I also update the following occurrence in ctype_read?
>> 	      if (ellipsis_token == tok_none)
>> 		{
>> 		  if (get_character (now, charmap, repertoire, &seq, &wch))
>> 		    goto err_label;
> 
> Oh, I had missed that.  If the calls are already inconsistent, you can
> use your original patch, too.
Okay. Then I'll use the original patch.
> 
> To be honest, I'm more concerned about the other calls to get_character
> without error checking.
Where do you see other ones?
With my patch applied, I just see the following occurrences of 
get_character which are now all checking the return value:
1257:get_character (struct token *now, const struct charmap_t *charmap,
1399:if (get_character (now, charmap, repertoire, &seq, &wch))
2291:if (get_character (now, charmap, repertoire, &seq, &wch))
2574:if (get_character (now, charmap, repertoire, &from_seq,
2585:if (get_character (now, charmap, repertoire, &to_seq,
> 
> Thanks,
> Florian
> 


  reply	other threads:[~2019-06-25 13:49 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-25 13:17 [PATCH] Fix build warnings in locale/programs/ld-ctype.c Stefan Liebler
2019-06-25 13:23 ` Florian Weimer
2019-06-25 13:33   ` Stefan Liebler
2019-06-25 13:39     ` Florian Weimer
2019-06-25 13:49       ` Stefan Liebler [this message]
2019-06-25 13:54         ` Florian Weimer
2019-06-26 10:32           ` Stefan Liebler

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

  List information: https://www.gnu.org/software/libc/involved.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6f5b060a-8260-9026-e34f-fedfc8e454fa@linux.ibm.com \
    --to=stli@linux.ibm.com \
    --cc=fweimer@redhat.com \
    --cc=libc-alpha@sourceware.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).