tech-userlevel archive

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

Re: ACPICA userland utilities reenable support for NetBSD



Christos Zoulas wrote:
> On Mar 8, 11:38am, n54%gmx.com@localhost ("Kamil Rytarowski") wrote:
> -- Subject: Re: ACPICA userland utilities reenable support for NetBSD
> 
> |  INSTALLFLAGS ?= -f
> | @@ -163,7 +167,6 @@ CFLAGS += \
> |  CWARNINGFLAGS = \
> |      -std=c99\
> |      -Wall\
> | -    -Wbad-function-cast\
> |      -Wdeclaration-after-statement\
> |      -Werror\
> |      -Wformat=2\
> | @@ -206,6 +209,11 @@ ifneq ($(HOST), _FreeBSD)
> |      endif
> |  endif
> |  
> | +ifneq ($(HOST), _NetBSD)
> | +    CWARNINGFLAGS += \
> | +        -Wbad-function-cast
> | +endif
> 
> Why? gcc-4.8 has that flag, do we produce warnings others don't?
> What warnings. Nevertheless even if you do it, you should explain.

Error message:

gcc -c -D_NetBSD -I../../../source/include -DACPI_ASL_COMPILER -I../../../source/compiler -Iobj -std=c99 -Wall -Wdeclaration-after-statement -Werror -Wformat=2 -Wmissing-declarations -Wmissing-prototypes -Wstrict-aliasing=0 -Wstrict-prototypes -Wswitch-default -Wpointer-arith -Wundef -Waddress -Waggregate-return -Winit-self -Winline -Wmissing-declarations -Wmissing-field-initializers -Wnested-externs -Wold-style-definition -Woverride-init -Wno-format-nonliteral -Wredundant-decls -Wempty-body -Wlogical-op -Wmissing-parameter-type -Wold-style-declaration -Wtype-limits -Wbad-function-cast -O2 -D_FORTIFY_SOURCE=2 -o obj/aslmapenter.o ../../../source/compiler/aslmapenter.c
In file included from ../../../source/include/acpi.h:130:0,
                 from ../../../source/compiler/aslmapenter.c:116:
../../../source/compiler/aslmapenter.c: In function 'MpCreateGpioInfo':
../../../source/include/actypes.h:610:48: error: cast from function call of type 'char *' to non-matching type 'long unsigned int' [-Werror=bad-function-cast]
 #define ACPI_CAST_PTR(t, p)             ((t *) (ACPI_UINTPTR_T) (p))
                                                ^
../../../source/compiler/aslmapenter.c:298:12: note: in expansion of macro 'ACPI_CAST_PTR'
     Info = ACPI_CAST_PTR (ACPI_GPIO_INFO,
            ^
../../../source/compiler/aslmapenter.c: In function 'MpCreateSerialInfo':
../../../source/include/actypes.h:610:48: error: cast from function call of type 'char *' to non-matching type 'long unsigned int' [-Werror=bad-function-cast]
 #define ACPI_CAST_PTR(t, p)             ((t *) (ACPI_UINTPTR_T) (p))
                                                ^
../../../source/compiler/aslmapenter.c:374:12: note: in expansion of macro 'ACPI_CAST_PTR'
     Info = ACPI_CAST_PTR (ACPI_SERIAL_INFO,
            ^
cc1: all warnings being treated as errors

Sources:

source/include/platform/acnetbsd.h:#define ACPI_UINTPTR_T          uintptr_t
source/include/actypes.h:#define ACPI_CAST_PTR(t, p)             ((t *) (ACPI_UINTPTR_T) (p))

Can we resolve it in some better way?

> 
> |  filename=patch-source-os_specific-service_layers-osnetbsdtbl.c
> 
> Ok, how is ours different than FreeBSD's? Can we just make osbsdtbl.c?
> 

Yes it's an option.
We are different only in the lack of kenv feature and different acpi root path in sysctl. I will do it.

> christos
> 


Home | Main Index | Thread Index | Old Index