Opened 9 years ago

Closed 8 years ago

#12778 closed bug (fixed)

[Patch] acpica: fix gcc6 warnings

Reported by: mt Owned by: tqh
Priority: normal Milestone: Unscheduled
Component: Drivers/ACPI Version: R1/Development
Keywords: add-ons/kernel/bus_managers/acpi/acpica Cc:
Blocked By: Blocking:
Platform: All

Description

In utdelete.c: and utinit.c, gcc6 x86_64 warns '-Wint-conversion'. Since ACPI_SEMAPHORE is defined as 'sem_id', I think we may use -1 instead of NULL.

/home/haiku/haiku/haiku/src/add-ons/kernel/bus_managers/acpi/acpica/components/utilities/utdelete.c: In function 'AcpiUtDeleteInternalObj':
/home/haiku/haiku/haiku/src/add-ons/kernel/bus_managers/acpi/acpica/components/utilities/utdelete.c:260:41: warning: assignment makes integer from pointer without a cast [-Wint-conversion]
             AcpiGbl_GlobalLockSemaphore = NULL;
                                         ^
/home/haiku/haiku/haiku/src/add-ons/kernel/bus_managers/acpi/acpica/components/utilities/utdelete.c:279:35: warning: assignment makes integer from pointer without a cast [-Wint-conversion]
         Object->Event.OsSemaphore = NULL;
                                   ^

/home/haiku/haiku/haiku/src/add-ons/kernel/bus_managers/acpi/acpica/components/utilities/utinit.c: In function 'AcpiUtInitGlobals':
/home/haiku/haiku/haiku/src/add-ons/kernel/bus_managers/acpi/acpica/components/utilities/utinit.c:283:41: warning: assignment makes integer from pointer without a cast [-Wint-conversion]
     AcpiGbl_GlobalLockSemaphore         = NULL;
                                         ^

Attachments (1)

0023-acpica-fix-gcc6-warnings.patch (2.2 KB ) - added by mt 9 years ago.

Download all attachments as: .zip

Change History (9)

comment:1 by mt, 9 years ago

patch: 01

comment:2 by tqh, 9 years ago

This patch needs to be sent to the ACPICA repo, as we import ACPICA without changes. See https://github.com/acpica/acpica.

comment:3 by tqh, 9 years ago

I'd also like to add that I'm very grateful of your work, please talk to me (tqh) or any other of the moderators on #haiku channel on IRC (https://www.haiku-os.org/community/irc). We need more Haiku developers.

comment:4 by korli, 8 years ago

@tqh AcpiGbl_GlobalLockSemaphore is a sem_id on Haiku, assigning it to NULL, results in this warning. https://github.com/haiku/haiku/blob/master/src/add-ons/kernel/bus_managers/acpi/acpica/include/platform/achaiku.h#L136

IMO ACPI_SEMAPHORE shall be a void*, and each function in ACPICAHaiku.cpp can cast to addr_t/sem_id.

comment:5 by tqh, 8 years ago

Sounds like a good idea, I actually reported a ACPICA bug for this, but then real life made me lose track of it. Your solution sounds like the best one.

https://github.com/acpica/acpica/issues/162

comment:6 by tqh, 8 years ago

Is this still an issue with gcc6 after hrev50968?

in reply to:  6 comment:7 by mt, 8 years ago

Replying to tqh:

Is this still an issue with gcc6 after hrev50968?

I tested hrev50983 and it is OK with gcc6, so this ticket can be closed.

comment:8 by waddlesplash, 8 years ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.