Re: [dev] [st] [PATCH] Replace close and dup with dup2.

From: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
Date: Mon, 27 Apr 2015 10:55:48 +0200

Hi,

> Matter of style maybe. It's still annoying to have noise in the build.

I don't admit this types of commits about quiting some compiler. First
point, warnings are not part of the standard, so you are free of take
care of them or not. If you don't like to have noise add some flags to
your local config.mk. Second I don't have any warning with any of
the compilers I use. Take a look to this session:

Script started on Mon 27 Apr 2015 10:42:13 AM CEST
$ echo $CC
c99
$ make clean all
cleaning
st build options:
CFLAGS = -g -std=c99 -pedantic -Wall -Wvariadic-macros -Os -I. -I/usr/include -I/usr/X11R6/include -I/usr/include/freetype2 -I/usr/include/freetype2 -DVERSION="0.5" -D_XOPEN_SOURCE=600
LDFLAGS = -g -L/usr/lib -lc -L/usr/X11R6/lib -lm -lrt -lX11 -lutil -lXext -lXft -lfontconfig -lfreetype -lfreetype
CC = c99
CC st.c
CC -o st
$ CC=pcc make clean all
cleaning
st build options:
CFLAGS = -g -std=c99 -pedantic -Wall -Wvariadic-macros -Os -I. -I/usr/include -I/usr/X11R6/include -I/usr/include/freetype2 -I/usr/include/freetype2 -DVERSION="0.5" -D_XOPEN_SOURCE=600
LDFLAGS = -g -L/usr/lib -lc -L/usr/X11R6/lib -lm -lrt -lX11 -lutil -lXext -lXft -lfontconfig -lfreetype -lfreetype
CC = pcc
CC st.c
/usr/include/stdc-predef.h:54: warning: __STDC_ISO_10646__ redefined (previously defined at "st.c" line -11)
CC -o st
$ CC=tcc make clean all
cleaning
st build options:
CFLAGS = -g -std=c99 -pedantic -Wall -Wvariadic-macros -Os -I. -I/usr/include -I/usr/X11R6/include -I/usr/include/freetype2 -I/usr/include/freetype2 -DVERSION="0.5" -D_XOPEN_SOURCE=600
LDFLAGS = -g -L/usr/lib -lc -L/usr/X11R6/lib -lm -lrt -lX11 -lutil -lXext -lXft -lfontconfig -lfreetype -lfreetype
CC = tcc
CC st.c
tcc: error: invalid option -- '-std=c99'
Makefile:21: recipe for target 'st.o' failed
make: *** [st.o] Error 1
$ ed config.mk
671
,s/-std=c99//
w
663
q
$ CC=tcc make clean all
cleaning
st build options:
CFLAGS = -g -pedantic -Wall -Wvariadic-macros -Os -I. -I/usr/include -I/usr/X11R6/include -I/usr/include/freetype2 -I/usr/include/freetype2 -DVERSION="0.5" -D_XOPEN_SOURCE=600
LDFLAGS = -g -L/usr/lib -lc -L/usr/X11R6/lib -lm -lrt -lX11 -lutil -lXext -lXft -lfontconfig -lfreetype -lfreetype
CC = tcc
CC st.c
CC -o st
$ git checkout config.mk
$ CC=gcc make clean all
cleaning
st build options:
CFLAGS = -g -std=c99 -pedantic -Wall -Wvariadic-macros -Os -I. -I/usr/include -I/usr/X11R6/include -I/usr/include/freetype2 -I/usr/include/freetype2 -DVERSION="0.5" -D_XOPEN_SOURCE=600
LDFLAGS = -g -L/usr/lib -lc -L/usr/X11R6/lib -lm -lrt -lX11 -lutil -lXext -lXft -lfontconfig -lfreetype -lfreetype
CC = gcc
CC st.c
CC -o st
$

Script done on Mon 27 Apr 2015 10:44:19 AM CEST


And third, this way of redirecting streams is the form you can find in any
book about Unix programming, so I don't see any problem in it. Maybe
you should send a patch to gcc to include dup in the "don't care return
value" function group.

Regards,
Received on Mon Apr 27 2015 - 10:55:48 CEST

This archive was generated by hypermail 2.3.0 : Mon Apr 27 2015 - 11:00:10 CEST