[prev in list] [next in list] [prev in thread] [next in thread] 

List:       busybox
Subject:    Re: [PATCH 4/7] xfuncs: Handle missing non-POSIX termios constants
From:       Denys Vlasenko <vda.linux () googlemail ! com>
Date:       2017-10-30 14:19:45
Message-ID: CAK1hOcO2kBrQtzm6vTRW2hpizm1-DLkDQv1f1_8MbtieO6ZE5w () mail ! gmail ! com
[Download RAW message or body]

Applied, thanks!

On Sun, Oct 8, 2017 at 5:01 PM, Kang-Che Sung <explorer09@gmail.com> wrote:
> On Sun, Oct 8, 2017 at 10:34 PM, Ralf Friedl <Ralf.Friedl@online.de> wrote:
>>
>> Because the way the line is now is one line with 8 values. Changing that to
>> use ifdefs for each value would change that one line to 3*8+2=26 lines, that
>> makes the code much harder to read and maintain. And there may be other
>> places where it is used. It's perfectly legitimate to define the values as
>> 0, like you would define O_BINARY as 0 on platforms that don't need/supply
>> it.
>
> Okay. I'm partially convinced about this argument. Consider that there are
> other places in busybox code that temporarily defines IUCLC to 0 for similar
> purpose:
>
> libbb/xfuncs.c
> libbb/bb_askpass.c
> coreutils/stty.c
> loginutils/getty.c
>
>> There is nothing wrong with that. It is possible to use "#if SIGUSR3" to
>> test for SIGUSR being defined and nonzero. It has the additional benefit
>> that you can use the value in a C statement (as opposed to a C preprocessor
>> test) and let the compiler optimize it out. Busybox does that a lot.
>
> My concern is that there're some macros that are defined to 0 for a
> purpose, e.g.
> #define O_RDONLY 0x0000
> so it's not a good idea in general to arbitrarily define a macro to 0 without
> knowing what you are doing. But for IUCLC and such, it might be safe.
>
> James (jrtc27), I apologize for my misunderstanding of the issue.
> _______________________________________________
> busybox mailing list
> busybox@busybox.net
> http://lists.busybox.net/mailman/listinfo/busybox
_______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic