Module Name:    src
Committed By:   rillig
Date:           Fri Mar 14 06:40:51 UTC 2025

Modified Files:
        src/usr.bin/xlint/llib: llib-lposix llib-lstdc

Log Message:
lint: fix definition of errno in lint standard libraries

In llib-lstdc, when errno is a macro expanding to a function, that
function was declared twice: once with prototype, once without; the
latter is redundant.

In llib-lposix, <errno.h> was not included, so errno was not defined as
a macro. Realign lposix with lstdc by adding <errno.h> and sorting the
included headers.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/usr.bin/xlint/llib/llib-lposix
cvs rdiff -u -r1.3 -r1.4 src/usr.bin/xlint/llib/llib-lstdc

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/xlint/llib/llib-lposix
diff -u src/usr.bin/xlint/llib/llib-lposix:1.2 src/usr.bin/xlint/llib/llib-lposix:1.3
--- src/usr.bin/xlint/llib/llib-lposix:1.2	Mon Jul  3 21:25:09 1995
+++ src/usr.bin/xlint/llib/llib-lposix	Fri Mar 14 06:40:51 2025
@@ -1,4 +1,4 @@
-/*	$NetBSD: llib-lposix,v 1.2 1995/07/03 21:25:09 cgd Exp $	*/
+/*	$NetBSD: llib-lposix,v 1.3 2025/03/14 06:40:51 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -39,23 +39,24 @@
 #include <sys/stat.h>
 #include <sys/utsname.h>
 #include <sys/times.h>
-#include <stdio.h>
-#include <stdarg.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <math.h>
-#include <time.h>
 #include <assert.h>
-#include <termios.h>
+#include <ctype.h>
 #include <dirent.h>
+#include <errno.h>
 #include <fcntl.h>
 #include <grp.h>
-#include <pwd.h>
-#include <ctype.h>
-#include <signal.h>
 #include <locale.h>
+#include <math.h>
+#include <pwd.h>
 #include <setjmp.h>
+#include <signal.h>
+#include <stdarg.h>
+#include <stdio.h>
+#include <stdlib.h>
 #include <string.h>
+#include <termios.h>
+#include <time.h>
+#include <unistd.h>
 #include <utime.h>
 
 
@@ -101,7 +102,9 @@ double	(difftime)(time_t time1, time_t t
 div_t	(div)(int numer, int denom);
 int	(dup)(int fildes);
 int	(dup2)(int fildes, int fildes2);
+#ifndef errno
 int	(errno);
+#endif
 int	(execl)(const char *path, const char *arg, ...);
 int	(execle)(const char *path, const char *arg, ...);
 int	(execlp)(const char *file, const char *arg, ...);

Index: src/usr.bin/xlint/llib/llib-lstdc
diff -u src/usr.bin/xlint/llib/llib-lstdc:1.3 src/usr.bin/xlint/llib/llib-lstdc:1.4
--- src/usr.bin/xlint/llib/llib-lstdc:1.3	Mon Jul  3 21:39:28 1995
+++ src/usr.bin/xlint/llib/llib-lstdc	Fri Mar 14 06:40:51 2025
@@ -1,4 +1,4 @@
-/*	$NetBSD: llib-lstdc,v 1.3 1995/07/03 21:39:28 cgd Exp $	*/
+/*	$NetBSD: llib-lstdc,v 1.4 2025/03/14 06:40:51 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -80,7 +80,9 @@ int	(toupper)(int c);
 /*
  * errno.h
  */
+#ifndef errno
 int	(errno);
+#endif
 
 /*
  * locale.h

Reply via email to