Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/xlint/lint1 lint: rename ops.c to oper.c



details:   https://anonhg.NetBSD.org/src/rev/7172e42d5ee1
branches:  trunk
changeset: 949334:7172e42d5ee1
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sat Jan 09 21:37:44 2021 +0000

description:
lint: rename ops.c to oper.c

The file ops.c had previously been autogenerated.  This meant that in a
NetBSD build, it was generated in OBJDIR, and a build that had just
updated src/usr.bin would fail.  For a build that last ran on
2020-12-01, and again today, it looks like this:

        #      link  lint1/lint1
        cc ... -o lint1 cgram.lo ... ops.lo ... tyname.lo
        /usr/bin/ld: ops.lo: in function `initmtab':
        ops.c:(.text+0x63): undefined reference to `STRUCT_ASSIGN'

This is caused by ops.c existing in OBJDIR, so the new version in
NETBSDSRCDIR is not looked at.  To prevent this, use oper.c instead as
the filename, which has not been used before.

https://mail-index.netbsd.org/source-changes-d/2021/01/09/msg013096.html

diffstat:

 usr.bin/xlint/lint1/Makefile |   6 ++--
 usr.bin/xlint/lint1/oper.c   |  64 ++++++++++++++++++++++++++++++++++++++++++++
 usr.bin/xlint/lint1/ops.c    |  64 --------------------------------------------
 3 files changed, 67 insertions(+), 67 deletions(-)

diffs (161 lines):

diff -r 53c892fc70e3 -r 7172e42d5ee1 usr.bin/xlint/lint1/Makefile
--- a/usr.bin/xlint/lint1/Makefile      Sat Jan 09 20:51:08 2021 +0000
+++ b/usr.bin/xlint/lint1/Makefile      Sat Jan 09 21:37:44 2021 +0000
@@ -1,10 +1,10 @@
-#      $NetBSD: Makefile,v 1.56 2021/01/05 23:50:29 rillig Exp $
+#      $NetBSD: Makefile,v 1.57 2021/01/09 21:37:44 rillig Exp $
 
 .include <bsd.own.mk>
 
 PROG=          lint1
 SRCS=          cgram.y decl.c emit.c emit1.c err.c func.c init.c inittyp.c \
-               main1.c mem.c mem1.c ops.c print.c scan.l tree.c tyname.c
+               main1.c mem.c mem1.c oper.c print.c scan.l tree.c tyname.c
 
 MAN=           lint.7
 YHEADER=
@@ -38,7 +38,7 @@
 DPADD+=                ${LIBL}
 .endif
 
-ops.o: ops.def
+oper.o: ops.def
 
 .include "Makefile.err-msgs-h"
 ${SRCS:Nerr.c}: err-msgs.h
diff -r 53c892fc70e3 -r 7172e42d5ee1 usr.bin/xlint/lint1/oper.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/usr.bin/xlint/lint1/oper.c        Sat Jan 09 21:37:44 2021 +0000
@@ -0,0 +1,64 @@
+/*     $NetBSD: oper.c,v 1.1 2021/01/09 21:37:44 rillig Exp $  */
+
+/*-
+ * Copyright (c) 2021 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Roland Illig.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/types.h>
+#include "op.h"
+#include "param.h"
+
+mod_t modtab[NOPS];
+
+static const struct {
+       mod_t   m;
+       unsigned char   ok;
+} imods[] =
+#define begin_ops() {
+#define op(name, repr, \
+               bi, lo, in, sc, ar, fo, va, ts, ba, se, \
+               lu, ru, pc, cm, ve, de, ew, ic, active) \
+       { { bi, lo, in, sc, ar, fo, va, ts, ba, se, \
+           lu, ru, pc, cm, ve, de, ew, ic, repr }, active },
+#define end_ops(n) };
+#include "ops.def"
+
+const char *
+getopname(op_t op) {
+       return imods[op].m.m_name;
+}
+
+void
+initmtab(void)
+{
+       size_t i;
+
+       for (i = 0; i < sizeof imods / sizeof imods[0]; i++)
+               if (imods[i].ok)
+                       modtab[i] = imods[i].m;
+}
diff -r 53c892fc70e3 -r 7172e42d5ee1 usr.bin/xlint/lint1/ops.c
--- a/usr.bin/xlint/lint1/ops.c Sat Jan 09 20:51:08 2021 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,64 +0,0 @@
-/*     $NetBSD: ops.c,v 1.1 2021/01/05 23:50:29 rillig Exp $   */
-
-/*-
- * Copyright (c) 2021 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Roland Illig.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
- * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <sys/types.h>
-#include "op.h"
-#include "param.h"
-
-mod_t modtab[NOPS];
-
-static const struct {
-       mod_t   m;
-       unsigned char   ok;
-} imods[] =
-#define begin_ops() {
-#define op(name, repr, \
-               bi, lo, in, sc, ar, fo, va, ts, ba, se, \
-               lu, ru, pc, cm, ve, de, ew, ic, active) \
-       { { bi, lo, in, sc, ar, fo, va, ts, ba, se, \
-           lu, ru, pc, cm, ve, de, ew, ic, repr }, active },
-#define end_ops(n) };
-#include "ops.def"
-
-const char *
-getopname(op_t op) {
-       return imods[op].m.m_name;
-}
-
-void
-initmtab(void)
-{
-       size_t i;
-
-       for (i = 0; i < sizeof imods / sizeof imods[0]; i++)
-               if (imods[i].ok)
-                       modtab[i] = imods[i].m;
-}



Home | Main Index | Thread Index | Old Index