Re: [dev] [st] [PATCH] Fix techo handling of control and multibyte characters.

2014-05-02 Thread Markus Wichmann
On Fri, Apr 25, 2014 at 04:42:09PM +0200, Roberto E. Vargas Caballero wrote: > The problem is Wall change from one system to another (this is something > OpenBSD users know with strcpy calls...), and it doesn't force how to > remove the warning, so at the end I think style is not really improved >

Re: [dev] [st] [PATCH] Fix techo handling of control and multibyte characters.

2014-04-29 Thread Christoph Lohmann
Greetings. On Tue, 29 Apr 2014 18:12:23 +0200 "Roberto E. Vargas Caballero" wrote: > > > In file included from /usr/X11R6/include/X11/Xlib.h:47, > > > from st.c:25: > > > /usr/X11R6/include/X11/Xfuncproto.h:144:24: warning: ISO C does not > > > permit named variadic macros > >

Re: [dev] [st] [PATCH] Fix techo handling of control and multibyte characters.

2014-04-28 Thread Roberto E. Vargas Caballero
> > In file included from /usr/X11R6/include/X11/Xlib.h:47, > > from st.c:25: > > /usr/X11R6/include/X11/Xfuncproto.h:144:24: warning: ISO C does not permit > > named variadic macros > > st.c: In function 'techo': > > st.c:2303: warning: comparison is always false due to limited r

Re: [dev] [st] [PATCH] Fix techo handling of control and multibyte characters.

2014-04-28 Thread Christoph Lohmann
Greetings. On Mon, 28 Apr 2014 18:05:54 +0200 "Roberto E. Vargas Caballero" wrote: > >> The problem is Wall change from one system to another (this is something > >> OpenBSD users know with strcpy calls...), and it doesn't force how to > >> remove the warning, so at the end I think style is no

Re: [dev] [st] [PATCH] Fix techo handling of control and multibyte characters.

2014-04-28 Thread Roberto E. Vargas Caballero
>> The problem is Wall change from one system to another (this is something >> OpenBSD users know with strcpy calls...), and it doesn't force how to >> remove the warning, so at the end I think style is not really improved >> with Wall (and guys, some of the warning are really, really stupid).

Re: [dev] [st] [PATCH] Fix techo handling of control and multibyte characters.

2014-04-25 Thread Roberto E. Vargas Caballero
> We can modify it as follows: > if(BETWEEN(c, 0x00, 0x1f) || c == 0x7f) { /* control code */ I like this solution because make explicit what we want to do. With the u suffix is a bit obscure and can generate some errors. > I also thought about using incntrl(). It should work the same way

Re: [dev] [st] [PATCH] Fix techo handling of control and multibyte characters.

2014-04-25 Thread Christoph Lohmann
Greetings. On Fri, 25 Apr 2014 16:51:15 +0200 "Roberto E. Vargas Caballero" wrote: > Hi, > > > We use ‐Wall to show all warnings. If the compiler complains, fix the > > warning. Easy. At least this keeps the code to a certain style. St was > > The problem is Wall change from one system to

Re: [dev] [st] [PATCH] Fix techo handling of control and multibyte characters.

2014-04-25 Thread Roberto E. Vargas Caballero
Hi, > We use ‐Wall to show all warnings. If the compiler complains, fix the > warning. Easy. At least this keeps the code to a certain style. St was The problem is Wall change from one system to another (this is something OpenBSD users know with strcpy calls...), and it doesn't force how to

Re: [dev] [st] [PATCH] Fix techo handling of control and multibyte characters.

2014-04-25 Thread noname
On Thu, Apr 24, 2014 at 07:29:35AM +0200, Roberto E. Vargas Caballero wrote: > Hello, > > > u suffix was here for a purpose. The patch has comment about multibyte > > characters. As 0x20u is unsigned, c was converted to unsigned char > > before comparison so multibyte characters were not conside

Re: [dev] [st] [PATCH] Fix techo handling of control and multibyte characters.

2014-04-24 Thread Christoph Lohmann
Greetings. On Thu, 24 Apr 2014 18:20:20 +0200 "Roberto E. Vargas Caballero" wrote: > Thinking a bit more about this, I don't know why we are using -Wall, > because it moves people to follow the GNU criteria, that is the > more suck criteria I know (I think it is because they come from the > LISP

Re: [dev] [st] [PATCH] Fix techo handling of control and multibyte characters.

2014-04-23 Thread Roberto E. Vargas Caballero
Hello, > u suffix was here for a purpose. The patch has comment about multibyte > characters. As 0x20u is unsigned, c was converted to unsigned char > before comparison so multibyte characters were not considered control > characters. I realized it after send the patch. I prefer use uchar inste

Re: [dev] [st] [PATCH] Fix techo handling of control and multibyte characters.

2014-04-23 Thread noname
On Wed, Apr 23, 2014 at 08:26:32PM +0200, Roberto E. Vargas Caballero wrote: > Applied with a small modification. Thanks u suffix was here for a purpose. The patch has comment about multibyte characters. As 0x20u is unsigned, c was converted to unsigned char before comparison so multibyte ch

Re: [dev] [st] [PATCH] Fix techo handling of control and multibyte characters.

2014-04-23 Thread Roberto E. Vargas Caballero
Applied with a small modification. Thanks -- Roberto E. Vargas Caballero

[dev] [st] [PATCH] Fix techo handling of control and multibyte characters.

2014-04-22 Thread noname
techo compares signed char to '\x20'. Any character with code less then '\x20' is treated as control character. This way characters with MSB set to 1 are considered control characters too. Also this patch makes techo display DEL character as ^?. To reprocuce the bug, enable echo mode using print