ed(1): make WARNS=6 clean
Although argc and argv are never read after the longjmp is complete, gcc is not clever enough to see that and needlessly warns about it. So add volatile to silence the compiler. Approved by: ed (the co-mentor, not ed(1))
This commit is contained in:
parent
7f72022f3d
commit
55fa734d20
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=204711
@ -4,7 +4,6 @@
|
||||
|
||||
PROG= ed
|
||||
SRCS= buf.c cbc.c glbl.c io.c main.c re.c sub.c undo.c
|
||||
WARNS?= 2
|
||||
LINKS= ${BINDIR}/ed ${BINDIR}/red
|
||||
MLINKS= ed.1 red.1
|
||||
|
||||
|
@ -103,15 +103,10 @@ const char usage[] = "usage: %s [-] [-sx] [-p string] [file]\n";
|
||||
|
||||
/* ed: line editor */
|
||||
int
|
||||
main(int argc, char *argv[])
|
||||
main(volatile int argc, char ** volatile argv)
|
||||
{
|
||||
int c, n;
|
||||
long status = 0;
|
||||
#if __GNUC__
|
||||
/* Avoid longjmp clobbering */
|
||||
(void) &argc;
|
||||
(void) &argv;
|
||||
#endif
|
||||
|
||||
(void)setlocale(LC_ALL, "");
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user