Project

General

Profile

Actions

Bug #6596

closed

Macro redefined in strtolctype.h

Added by Gary Mills over 5 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
bootloader
Start date:
2016-02-03
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
needs-triage
Gerrit CR:

Description

While building a January illumos on my T2000 (sun4v SPARC) the following errors appeared:

+ /opt/SUNWspro/bin/cc -xO3 -m64 -dalign -v -Wc,-Qiselect-regsym=0
-Wc,-Qassembler-ounrefsym=0 -xspace -W0,-Lt -Xa -xildoff -errtags=yes
-errwarn=%all -erroff=E_EMPTY_TRANSLATION_UNIT
-erroff=E_STATEMENT_NOT_REACHED -xc99=%none -Wd,-xsafe=unboundsym
-W2,-xwrap_int -W0,-xglobalstatic -xchip=ultra -Wc,-xcode=abs32
-Dsun4u -D_BOOT -D_KERNEL -D_MACHDEP -YI,../../lib/sa -I../../lib/sa
-I../.. -I. -I../fs/common -I../../sparc -I../../../uts/common
-I../../../uts/sparc -I../../../uts/sparc/v9 -I../../../uts/sun
-I../../../uts/sun4 -I../../../uts/sun4u -I../../lib/sock
-D_SYS_STREAM_H -c -o /tmp/nightly.tmpdir.971992/.cwCAAN3WuLz.o
../../../common/util/strtol.c
o Errors:
"../../../common/util/strtolctype.h", line 49: macro redefined: isalnum (E_MACRO_REDEFINED)
"../../../common/util/strtolctype.h", line 50: macro redefined: isalpha (E_MACRO_REDEFINED)
...

along with similar errors for the gcc compiler. It was compiling ../../../common/util/strtol.c in usr/src/stand/lib/sa at the time. It was attempting to build a stand-alone boot archive, only needed on SPARC hardware. The cause of this error seems to be a change to usr/src/common/util/strtolctype.h that was introduced in November 2015 as a part of bug #5886 . Here's the change:

@@ -44,7 +44,7 @@
  * safe in probe context.
  */

-#if    defined(_KERNEL) && !defined(_BOOT)
+#if    defined(_KERNEL) || defined(_BOOT)

 #define    isalnum(ch)    (isalpha(ch) || isdigit(ch))
 #define    isalpha(ch)    (isupper(ch) || islower(ch))
@@ -56,7 +56,7 @@
 #define    isxdigit(ch)    (isdigit(ch) || ((ch) >= 'a' && (ch) <= 'f') || \
             ((ch) >= 'A' && (ch) <= 'F'))

-#endif    /* _KERNEL && !_BOOT */
+#endif    /* _KERNEL || _BOOT */

 #define    DIGIT(x)    \
     (isdigit(x) ? (x) - '0' : islower(x) ? (x) + 10 - 'a' : (x) + 10 - 'A')

This particular build defines both _BOOT and _KERNEL, resulting in the redefined macros in strtolctype.h . The other header files used in this build are private copies contained in usr/src/stand/lib/sa .

Actions #1

Updated by Electric Monk over 5 years ago

  • Status changed from Feedback to Closed
  • % Done changed from 50 to 100

git commit bcf23f43dc1b73080eeded927585ee86feab40a7

commit  bcf23f43dc1b73080eeded927585ee86feab40a7
Author: Gary Mills <gary_mills@fastmail.fm>
Date:   2016-02-26T23:21:31.000Z

    6596 Macro redefined in strtolctype.h
    Reviewed by: Garrett D'Amore <garrett@damore.org>
    Approved by: Dan McDonald <danmcd@omniti.com>

Actions

Also available in: Atom PDF