bug-mes
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] ntoab: Handle LONG_MIN case.


From: Jan Nieuwenhuizen
Subject: Re: [PATCH] ntoab: Handle LONG_MIN case.
Date: Wed, 03 Jun 2020 21:04:50 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux)

Danny Milosavljevic writes:

Hello Danny,

> On Wed, 03 Jun 2020 08:02:28 +0200
> Jan Nieuwenhuizen <janneke@gnu.org> wrote:
>
>> Danny Milosavljevic writes:
>> 
>> > * lib/mes/ntoab.c (ntoab): Handle LONG_MIN case.
>> > ---
>> >  lib/mes/ntoab.c | 6 ++++++
>> >  1 file changed, 6 insertions(+)
>> >
>> > diff --git a/lib/mes/ntoab.c b/lib/mes/ntoab.c
>> > index ce91c73a..382e2326 100644
>> > --- a/lib/mes/ntoab.c
>> > +++ b/lib/mes/ntoab.c
>> > @@ -20,10 +20,16 @@
>> >  
>> >  #include <assert.h>
>> >  #include <mes/lib.h>
>> > +#include <stdint.h>
>> > +
>> > +#define STR(x) #x
>> > +#define XSTR(s) STR(s)
>> >  
>> >  char *
>> >  ntoab (long x, int base, int signed_p)
>> >  {
>> > +  if (x == LONG_MIN && base == 10)
>> > +    return XSTR(LONG_MIN);  
>> 
>> Wondering what happens if base == 8, or base == 16 and x == LONG_MIN?
>
> It's a problem ;)

Ah, okay... Not sure how important it is; just asking to create
awareness that we may be hit by this... It may be better to somehow
prepare for that.

> Are only base in {10, 8, 16} supposed to be allowed--or any random base, too?

I think any random base should work (TM), but those are used for certain
(base 2 probably too :-)

Greetings,
Janneke

-- 
Jan Nieuwenhuizen <janneke@gnu.org> | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | AvatarĀ® http://AvatarAcademy.com



reply via email to

[Prev in Thread] Current Thread [Next in Thread]