Opened 3 years ago

Closed 2 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:
Has a Patch: yes 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 3 years ago.

Download all attachments as: .zip

Change History (9)

Changed 3 years ago by mt

comment:1 Changed 3 years ago by mt

Has a Patch: set

comment:2 Changed 3 years ago by tqh

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

comment:3 Changed 3 years ago by tqh

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 Changed 2 years ago by korli

@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 Changed 2 years ago by tqh

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 Changed 2 years ago by tqh

Is this still an issue with gcc6 after hrev50968?

comment:7 in reply to:  6 Changed 2 years ago by mt

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 Changed 2 years ago by waddlesplash

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