Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 10 Jul 1997 10:54:39 -0700 (PDT)
From:      Chris Timmons <skynyrd@opus.cts.cwu.edu>
To:        charnier@freebsd.org
Cc:        freebsd-current@freebsd.org
Subject:   global broken
Message-ID:  <Pine.BSF.3.95.970710104619.17142A-100000@opus.cts.cwu.edu>

next in thread | raw e-mail | index | archive | help


Revision 1.3 of usr.bin/global/gctags/ctags.c changed the copyright string
to be read only.  An interesting bit of cruft further down in the file
writes to the now const data.  Compiler warnings and run-time bus errors
follow:

The change:

RCS file: /home/ncvs//src/usr.bin/global/gctags/ctags.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -r1.2 -r1.3
35c35
< static char copyright[] =
---
> static const char copyright[] =


The compiler warning:

cc -g -O -I/usr/src/usr.bin/global/gctags -DGTAGS -DBUGFIX -DMODIFY -DYACC
-c /usr/src/usr.bin/global/gctags/ctags.c
/usr/src/usr.bin/global/gctags/ctags.c: In function `main':
/usr/src/usr.bin/global/gctags/ctags.c:112: warning: assignment of
read-only location

The bus error


Program received signal SIGBUS, Bus error.

main (argc=3, argv=0xefbfd758) at
    /usr/src/usr.bin/global/gctags/ctags.c:112

112             copyright[0] = copyright[0]; /* to satisfy compiler */
(gdb) 



FIX:  IMHO since we are maintaining this on a vendor branch we should just
remove the silly line 112 and the #ifdef LINT that surrounds it.

-Chris




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.3.95.970710104619.17142A-100000>