Re: Unable to build acpi_asus module on current today



From: Jung-uk Kim <jkim@xxxxxxxxxxx>
Date: Thu, 29 Jun 2006 20:59:45 -0400

On Thursday 29 June 2006 07:30 pm, Kevin Oberman wrote:
Today I tried rebuilding my laptop running current. Building the
kernel module acpi_asus, the build bombed with the error:
===> acpi_asus (all)
cc -O2 -fno-strict-aliasing -pipe -Werror -D_KERNEL -DKLD_MODULE
-nostdinc -I-
-I/usr/src/sys/modules/acpi/acpi_asus/../../../contrib/dev/acpica
-I. -I@ -I@/contrib/altq -finline-limit=8000 --param
inline-unit-growth=100 --param large-function-growth=1000
-fno-common -mno-align-long-strings -mpreferred-stack-boundary=2
-mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -ffreestanding
-Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes
-Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual -Wundef
-fformat-extensions -c /usr/src/sys/modules
/acpi/acpi_asus/../../../dev/acpi_support/acpi_asus.c
/usr/src/sys/modules/acpi/acpi_asus/../../../dev/acpi_support/acpi_
asus.c: In function `acpi_asus_attach':
/usr/src/sys/modules/acpi/acpi_asus/../../../dev/acpi_support/acpi_
asus.c:584: error: 'for' loop initial declaration used outside C99
mode

But this module has not been touched since April and I have built
all of it many times since then. Several other modules seem to have
the same problem of declaring a variable in a for statement.

I moved the declaration to its own statement before the "for" and
it compiles fine.

Did some compiler default recently change? I have no compile
options on my make.conf.

Yes:

http://docs.freebsd.org/cgi/mid.cgi?200606292115.k5TLFQch022605

A quick fix:

Index: sys/conf/kmod.mk
===================================================================
RCS file: /home/ncvs/src/sys/conf/kmod.mk,v
retrieving revision 1.208
diff -u -r1.208 kmod.mk
--- sys/conf/kmod.mk 27 May 2006 16:32:05 -0000 1.208
+++ sys/conf/kmod.mk 30 Jun 2006 00:57:37 -0000
@@ -85,8 +85,10 @@
.if ${CC} == "icc"
NOSTDINC= -X
.else
+C_DIALECT= -std=c99
NOSTDINC= -nostdinc
.endif
+CFLAGS+= ${C_DIALECT}
CFLAGS:= ${CFLAGS:N-I*} ${NOSTDINC} -I- ${INCLMAGIC} ${CFLAGS:M-I*}
.if defined(KERNBUILDDIR)
CFLAGS+= -DHAVE_KERNEL_OPTION_HEADERS -include ${KERNBUILDDIR}/opt_global.h

Jung-uk,

Thanks you so much. I might have found this, but it would have taken a
long time!

Looks like this needs to be fixed in the base system or all of the
modules need to be checked and fixed to compile with the new flags.
--
R. Kevin Oberman, Network Engineer
Energy Sciences Network (ESnet)
Ernest O. Lawrence Berkeley National Laboratory (Berkeley Lab)
E-mail: oberman@xxxxxx Phone: +1 510 486-8634
_______________________________________________
freebsd-current@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscribe@xxxxxxxxxxx"



Relevant Pages

  • Re: Defining variable in C header file related doubt
    ... And it didn't compile, obviously. ... with int g declared in both files (and apparently ... "An external def1nition is an external declaration that is also a ... If an identif1er declared with external linkage is used in an ...
    (comp.lang.c)
  • Re: Syntax directed compilation
    ... seems to be "too much power, users write their own languages and then ... The declaration statements are executed ... compile time. ... is also a statement which is executed at compile time. ...
    (comp.compilers)
  • Re: CFormView adding GetDocument() functionality results in error C2143: syntax error : missing ; be
    ... All MFC wizard-generated code ... Well, 2 in favor of forward declaration, so that is what I am going to do. ... >> I noticed Document and Debug support missing from the class, ... >> I don't understand why it can't compile if the ...
    (microsoft.public.vc.mfc)
  • Re: Sendmail Core Dumps and Compiling Sendmail 8.11.7 on AIX 5.2 ml6
    ... Sendmail Core Dumps and Compiling Sendmail 8.11.7 on AIX 5.2 ml6 ... I'm using the IBM C compiler and gcc. ... If I try and compile with the IBM C compiler I get the following messages ... from previous declaration on line 267 of "/usr/include/stdio.h". ...
    (AIX-L)
  • Re: multiple markups
    ... Dim curPercent As Currency ... you say, in function/subroutine declarations, it won't compile. ... It gives an error as soon as you leave the declaration line ... public module-level variables so that the values can be much more ...
    (comp.databases.ms-access)