Skip to content

Commit c391641

Browse files
committed
Eliminate warnings for ignored fprintf() result when printing messages to stderr
1 parent 38862dd commit c391641

File tree

15 files changed

+86
-86
lines changed

15 files changed

+86
-86
lines changed

src/common.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,14 +64,14 @@ LispPTR Uraid_mess = NIL;
6464
int error(const char *cp) {
6565
char *ptr;
6666
if (device_before_raid() < 0) {
67-
fprintf(stderr, "Can't Enter URAID.\n");
67+
(void)fprintf(stderr, "Can't Enter URAID.\n");
6868
exit(-1);
6969
}
7070
/* comm read */
7171
URaid_errmess = cp;
72-
fprintf(stderr, "\n*Error* %s\n", cp);
72+
(void)fprintf(stderr, "\n*Error* %s\n", cp);
7373
fflush(stdin);
74-
fprintf(stderr, "Enter the URaid\n");
74+
(void)fprintf(stderr, "Enter the URaid\n");
7575
print(Uraid_mess);
7676
putchar('\n');
7777
/* XXX: make sure output is flushed so we can see where we are */

src/dlpi.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ int setup_dlpi_dev(char *device)
188188
dlbindreq(fd, 0x0600, 0, DL_CLDLS, 0, 0);
189189

190190
if (dlbindack(fd, buf) < 0) {
191-
fprintf(stderr, "%s: dlbindack failed.\n", pname);
191+
(void)fprintf(stderr, "%s: dlbindack failed.\n", pname);
192192
return (-1);
193193
}
194194

@@ -202,14 +202,14 @@ int setup_dlpi_dev(char *device)
202202
dlpromisconreq(fd, DL_PROMISC_SAP);
203203

204204
if (dlokack(fd, buf) < 0) {
205-
fprintf(stderr, "%s: DL_PROMISC_SAP failed.\n", pname);
205+
(void)fprintf(stderr, "%s: DL_PROMISC_SAP failed.\n", pname);
206206
return (-1);
207207
}
208208

209209
dlpromisconreq(fd, DL_PROMISC_MULTI);
210210

211211
if (dlokack(fd, buf) < 0) {
212-
fprintf(stderr, "%s: DL_PROMISC_MULTI failed.\n", pname);
212+
(void)fprintf(stderr, "%s: DL_PROMISC_MULTI failed.\n", pname);
213213
return (-1);
214214
}
215215

@@ -329,8 +329,8 @@ int dlpi_devtype(int fd)
329329
case DL_FDDI: return (DLT_FDDI);
330330
#endif
331331
default:
332-
fprintf(stderr, "%s: DLPI MACtype %ld unknown, ", pname, (long)dlp->info_ack.dl_mac_type);
333-
fprintf(stderr, "assuming ethernet.\n");
332+
(void)fprintf(stderr, "%s: DLPI MACtype %ld unknown, ", pname, (long)dlp->info_ack.dl_mac_type);
333+
(void)fprintf(stderr, "assuming ethernet.\n");
334334
return (DLT_EN10MB);
335335
}
336336
}
@@ -585,7 +585,7 @@ static int strgetmsg(int fd, struct strbuf *ctlp, struct strbuf *datap, int *fla
585585
/*
586586
* sigalrm - handle alarms.
587587
*/
588-
static void sigalrm(int sig) { (void)fprintf(stderr, "dlpi: timeout\n"); }
588+
static void sigalrm(int sig) { (void)(void)fprintf(stderr, "dlpi: timeout\n"); }
589589

590590
/*
591591
* savestr - save string in dynamic memory.
@@ -595,7 +595,7 @@ static char *savestr(char *s)
595595
char *t;
596596

597597
if ((t = malloc(strlen(s) + 1)) == NULL) {
598-
(void)fprintf(stderr, "%s: out of memory.\n", pname);
598+
(void)(void)fprintf(stderr, "%s: out of memory.\n", pname);
599599
(void)exit(1);
600600
}
601601

src/dspif.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ void make_dsp_instance(DspInterface dsp, char *lispbitmap, int width_hint, int h
5959
} else if (VGA_p()) {
6060
VGA_init(dsp, 0, 0, 0, depth_hint);
6161
} else { /* Can't set *ANY* video mode! */
62-
(void)fprintf(stderr, "No portable graphics mode supported by this host.\n");
63-
(void)fprintf(stderr, "\n-Expected VESA or VGA.\n");
62+
(void)(void)fprintf(stderr, "No portable graphics mode supported by this host.\n");
63+
(void)(void)fprintf(stderr, "\n-Expected VESA or VGA.\n");
6464
exit(1);
6565
}
6666
break;
@@ -69,7 +69,7 @@ void make_dsp_instance(DspInterface dsp, char *lispbitmap, int width_hint, int h
6969
#elif XWINDOW
7070
/* lispbitmap is 0 when we call X_init the first time. */
7171
if (X_init(dsp, 0, LispDisplayRequestedWidth, LispDisplayRequestedHeight, depth_hint) == NULL) {
72-
fprintf(stderr, "Can't open display.");
72+
(void)fprintf(stderr, "Can't open display.");
7373
exit(-1);
7474
}
7575
#endif /* DOS | XWINDOW */
@@ -87,7 +87,7 @@ void GenericReturnVoid(void *d) {(void)d; return; }
8787
void GenericPanic(void *d) {
8888
(void)d;
8989
TPRINT(("Enter GenericPanic\n"));
90-
fprintf(stderr, "Panic! Call to uninitialized display slot!");
90+
(void)fprintf(stderr, "Panic! Call to uninitialized display slot!");
9191
exit(0);
9292
}
9393

src/initsout.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ void init_ifpage(unsigned sysout_size) {
124124
new_lastvmem = (sysout_size * PAGES_IN_MBYTE) - 1;
125125

126126
if ((!Storage_expanded) && (InterfacePage->dllastvmempage != new_lastvmem)) {
127-
fprintf(stderr, "You can't expand VMEM\n");
127+
(void)fprintf(stderr, "You can't expand VMEM\n");
128128
exit(-1);
129129
} else { /* Set value which will be set to \\LASTVMEMFILEPAGE in LISP */
130130
InterfacePage->dllastvmempage = new_lastvmem;

src/ldeboot.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ int main(int argc, char *argv[]) {
9393
for (i = 1; i < argc; i++) {
9494
if ((strcmp(argv[i], "-d") == 0) || (strcmp(argv[i], "-display") == 0)) {
9595
if (i == argc - 1) {
96-
fprintf(stderr, "Missing argument to -display option.\n");
96+
(void)fprintf(stderr, "Missing argument to -display option.\n");
9797
exit(1);
9898
}
9999
displayName = argv[++i];
@@ -138,7 +138,7 @@ int main(int argc, char *argv[]) {
138138
filetorun = LDEX;
139139
goto run;
140140
} else {
141-
fprintf(stderr, "Unable to open X11 display %s\n",
141+
(void)fprintf(stderr, "Unable to open X11 display %s\n",
142142
displayName ? displayName : "from DISPLAY");
143143
exit(1);
144144
}
@@ -147,7 +147,7 @@ int main(int argc, char *argv[]) {
147147

148148
#ifdef USESUNSCREEN
149149
if ((FrameBufferFd = open("/dev/fb", O_RDWR)) < 0) {
150-
fprintf(stderr, "lde: can't open FrameBuffer\n");
150+
(void)fprintf(stderr, "lde: can't open FrameBuffer\n");
151151
exit(1);
152152
}
153153
if (ioctl(FrameBufferFd, FBIOGTYPE, &my_screen) < 0) {
@@ -187,7 +187,7 @@ int main(int argc, char *argv[]) {
187187

188188
run:
189189
if (filetorun == NULL) {
190-
fprintf(stderr, "Unable to determine what display program to run.\n");
190+
(void)fprintf(stderr, "Unable to determine what display program to run.\n");
191191
exit(1);
192192
}
193193

src/ldsout.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -121,14 +121,14 @@ unsigned sysout_loader(const char *sysout_file_name, unsigned sys_size) {
121121
*/
122122
#ifndef NOVERSION
123123
if (ifpage.lversion < LVERSION) {
124-
fprintf(stderr, "Lisp VM is too old for this emulator.\n");
125-
fprintf(stderr, "(version is %d, must be at least %d.)\n", ifpage.lversion, LVERSION);
124+
(void)fprintf(stderr, "Lisp VM is too old for this emulator.\n");
125+
(void)fprintf(stderr, "(version is %d, must be at least %d.)\n", ifpage.lversion, LVERSION);
126126
exit(-1);
127127
}
128128

129129
if (ifpage.minbversion > MINBVERSION) {
130-
fprintf(stderr, "Emulator is too old for this Lisp VM.\n");
131-
fprintf(stderr, "(version is %d, must be at least %d.)\n", MINBVERSION, ifpage.minbversion);
130+
(void)fprintf(stderr, "Emulator is too old for this Lisp VM.\n");
131+
(void)fprintf(stderr, "(version is %d, must be at least %d.)\n", MINBVERSION, ifpage.minbversion);
132132
exit(-1);
133133
}
134134
#endif /* NOVERSION */
@@ -157,9 +157,9 @@ unsigned sysout_loader(const char *sysout_file_name, unsigned sys_size) {
157157
/* Hence we have to observe the display protocol. */
158158
VESA_errorexit(tmp);
159159
#else
160-
fprintf(stderr, "sysout_loader: You can't specify the process size.\n");
161-
fprintf(stderr, "Because, secondary space is already used.\n");
162-
fprintf(stderr, "(size is %d, you specified %d.)\n", ifpage.process_size, sys_size);
160+
(void)fprintf(stderr, "sysout_loader: You can't specify the process size.\n");
161+
(void)fprintf(stderr, "Because, secondary space is already used.\n");
162+
(void)fprintf(stderr, "(size is %d, you specified %d.)\n", ifpage.process_size, sys_size);
163163
exit(-1);
164164
#endif /* DOS */
165165
}
@@ -176,7 +176,7 @@ unsigned sysout_loader(const char *sysout_file_name, unsigned sys_size) {
176176

177177
lispworld_scratch = mmap(0, sys_size * MBYTE, PROT_READ|PROT_WRITE, MAP_ANON | MAP_PRIVATE, -1, 0);
178178
if (lispworld_scratch == MAP_FAILED) {
179-
fprintf(stderr, "sysout_loader: can't allocate Lisp %dMBytes VM \n", sys_size);
179+
(void)fprintf(stderr, "sysout_loader: can't allocate Lisp %dMBytes VM \n", sys_size);
180180
exit(-1);
181181
}
182182

src/main.c

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@ int main(int argc, char *argv[])
364364
}
365365

366366
if (argv[i] && ((strcmp(argv[i], "-help") == 0) || (strcmp(argv[i], "-HELP") == 0))) {
367-
fprintf(stderr, "%s%s", helpstring, nethubHelpstring);
367+
(void)fprintf(stderr, "%s%s", helpstring, nethubHelpstring);
368368
exit(0);
369369
}
370370

@@ -387,7 +387,7 @@ int main(int argc, char *argv[])
387387
}
388388
if (access(sysout_name, R_OK)) {
389389
perror("Couldn't find a sysout to run");
390-
fprintf(stderr, "%s%s", helpstring, nethubHelpstring);
390+
(void)fprintf(stderr, "%s%s", helpstring, nethubHelpstring);
391391
exit(1);
392392
}
393393
/* OK, sysout name is now in sysout_name, and i is moved past a supplied name */
@@ -403,11 +403,11 @@ int main(int argc, char *argv[])
403403
if (errno == 0 && tmpint > 0) {
404404
TIMER_INTERVAL = tmpint;
405405
} else {
406-
fprintf(stderr, "Bad value for -t (integer > 0)\n");
406+
(void)fprintf(stderr, "Bad value for -t (integer > 0)\n");
407407
exit(1);
408408
}
409409
} else {
410-
fprintf(stderr, "Missing argument after -t\n");
410+
(void)fprintf(stderr, "Missing argument after -t\n");
411411
exit(1);
412412
}
413413
}
@@ -419,11 +419,11 @@ int main(int argc, char *argv[])
419419
if (errno == 0 && tmpint > 0) {
420420
sysout_size = (unsigned)tmpint;
421421
} else {
422-
fprintf(stderr, "Bad value for -m (integer > 0)\n");
422+
(void)fprintf(stderr, "Bad value for -m (integer > 0)\n");
423423
exit(1);
424424
}
425425
} else {
426-
fprintf(stderr, "Missing argument after -m\n");
426+
(void)fprintf(stderr, "Missing argument after -m\n");
427427
exit(1);
428428
}
429429
}
@@ -462,30 +462,30 @@ int main(int argc, char *argv[])
462462
if (argc > ++i) {
463463
int read = sscanf(argv[i], "%dx%d", &width, &height);
464464
if(read != 2) {
465-
fprintf(stderr, "Could not parse -sc argument %s\n", argv[i]);
465+
(void)fprintf(stderr, "Could not parse -sc argument %s\n", argv[i]);
466466
exit(1);
467467
}
468468
} else {
469-
fprintf(stderr, "Missing argument after -sc\n");
469+
(void)fprintf(stderr, "Missing argument after -sc\n");
470470
exit(1);
471471
}
472472
} else if ((strcmp(argv[i], "-pixelscale") == 0) || (strcmp(argv[i], "-PIXELSCALE") == 0)) {
473473
if (argc > ++i) {
474474
int read = sscanf(argv[i], "%d", &pixelscale);
475475
if(read != 1) {
476-
fprintf(stderr, "Could not parse -pixelscale argument %s\n", argv[i]);
476+
(void)fprintf(stderr, "Could not parse -pixelscale argument %s\n", argv[i]);
477477
exit(1);
478478
}
479479
} else {
480-
fprintf(stderr, "Missing argument after -pixelscale\n");
480+
(void)fprintf(stderr, "Missing argument after -pixelscale\n");
481481
exit(1);
482482
}
483483
} else if ((strcmp(argv[i], "-t") == 0) || (strcmp(argv[i], "-T") == 0)
484484
|| (strcmp(argv[i], "-title") == 0) || (strcmp(argv[i], "-TITLE") == 0)) {
485485
if (argc > ++i) {
486486
windowtitle = argv[i];
487487
} else {
488-
fprintf(stderr, "Missing argument after -title\n");
488+
(void)fprintf(stderr, "Missing argument after -title\n");
489489
exit(1);
490490
}
491491
}
@@ -511,7 +511,7 @@ int main(int argc, char *argv[])
511511
ether_host[4] = b4;
512512
ether_host[5] = b5;
513513
} else {
514-
fprintf(stderr, "Missing or bogus -E argument\n");
514+
(void)fprintf(stderr, "Missing or bogus -E argument\n");
515515
ether_fd = -1;
516516
exit(1);
517517
}
@@ -524,7 +524,7 @@ int main(int argc, char *argv[])
524524
if (argc > ++i) {
525525
setNethubHost(argv[i]);
526526
} else {
527-
fprintf(stderr, "Missing argument after -nh-host\n");
527+
(void)fprintf(stderr, "Missing argument after -nh-host\n");
528528
exit(1);
529529
}
530530
}
@@ -535,11 +535,11 @@ int main(int argc, char *argv[])
535535
if (errno == 0 && tmpint > 0) {
536536
setNethubPort(tmpint);
537537
} else {
538-
fprintf(stderr, "Bad value for -nh-port\n");
538+
(void)fprintf(stderr, "Bad value for -nh-port\n");
539539
exit(1);
540540
}
541541
} else {
542-
fprintf(stderr, "Missing argument after -nh-port\n");
542+
(void)fprintf(stderr, "Missing argument after -nh-port\n");
543543
exit(1);
544544
}
545545
}
@@ -549,11 +549,11 @@ int main(int argc, char *argv[])
549549
if (sscanf(argv[i], "%x-%x-%x-%x-%x-%x", &b0, &b1, &b2, &b3, &b4, &b5) == 6) {
550550
setNethubMac(b0, b1, b2, b3, b4, b5);
551551
} else {
552-
fprintf(stderr, "Invalid argument for -nh-mac\n");
552+
(void)fprintf(stderr, "Invalid argument for -nh-mac\n");
553553
exit(1);
554554
}
555555
} else {
556-
fprintf(stderr, "Missing argument after -nh-mac\n");
556+
(void)fprintf(stderr, "Missing argument after -nh-mac\n");
557557
exit(1);
558558
}
559559
}
@@ -564,11 +564,11 @@ int main(int argc, char *argv[])
564564
if (errno == 0 && tmpint >= 0) {
565565
setNethubLogLevel(tmpint);
566566
} else {
567-
fprintf(stderr, "Bad value for -nh-loglevel\n");
567+
(void)fprintf(stderr, "Bad value for -nh-loglevel\n");
568568
exit(1);
569569
}
570570
} else {
571-
fprintf(stderr, "Missing argument after -nh-loglevel\n");
571+
(void)fprintf(stderr, "Missing argument after -nh-loglevel\n");
572572
exit(1);
573573
}
574574
}
@@ -582,11 +582,11 @@ int main(int argc, char *argv[])
582582
if (errno == 0 && tmpint > 1000) {
583583
insnsCountdownForTimerAsyncEmulation = tmpint;
584584
} else {
585-
fprintf(stderr, "Bad value for -intr-emu-insns (integer > 1000)\n");
585+
(void)fprintf(stderr, "Bad value for -intr-emu-insns (integer > 1000)\n");
586586
exit(1);
587587
}
588588
} else {
589-
fprintf(stderr, "Missing argument after -intr-emu-insns\n");
589+
(void)fprintf(stderr, "Missing argument after -intr-emu-insns\n");
590590
exit(1);
591591
}
592592
}
@@ -600,11 +600,11 @@ int main(int argc, char *argv[])
600600
if (errno == 0 && tmpint > 0) {
601601
maxpages = (unsigned)tmpint;
602602
} else {
603-
fprintf(stderr, "Bad value for -xpages (integer > 0)\n");
603+
(void)fprintf(stderr, "Bad value for -xpages (integer > 0)\n");
604604
exit(1);
605605
}
606606
} else {
607-
fprintf(stderr, "Missing argument after -xpages\n");
607+
(void)fprintf(stderr, "Missing argument after -xpages\n");
608608
exit(1);
609609
}
610610
}
@@ -615,9 +615,9 @@ int main(int argc, char *argv[])
615615
probemouse(); /* See if the mouse is connected. */
616616
#else
617617
if (getuid() != geteuid()) {
618-
fprintf(stderr, "Effective user is not real user. Resetting uid\n");
618+
(void)fprintf(stderr, "Effective user is not real user. Resetting uid\n");
619619
if (setuid(getuid()) == -1) {
620-
fprintf(stderr, "Unable to reset user id to real user id\n");
620+
(void)fprintf(stderr, "Unable to reset user id to real user id\n");
621621
exit(1);
622622
}
623623
}
@@ -641,7 +641,7 @@ int main(int argc, char *argv[])
641641

642642
if (FindUnixPipes()) /* must call the routine to allocate storage, */
643643
{ /* in case we're re-starting a savevm w/open ptys */
644-
if (please_fork) fprintf(stderr, "Failed to find UNIXCOMM file handles; no processes\n");
644+
if (please_fork) (void)fprintf(stderr, "Failed to find UNIXCOMM file handles; no processes\n");
645645
}
646646
#endif /* DOS */
647647

@@ -665,7 +665,7 @@ int main(int argc, char *argv[])
665665

666666
/* file system directory enumeration stuff */
667667
if (!init_finfo()) {
668-
fprintf(stderr, "Cannot allocate internal data.\n");
668+
(void)fprintf(stderr, "Cannot allocate internal data.\n");
669669
exit(1);
670670
}
671671
#ifdef RS232

0 commit comments

Comments
 (0)