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)
Change History (9)
by , 9 years ago
Attachment: | 0023-acpica-fix-gcc6-warnings.patch added |
---|
comment:1 by , 9 years ago
patch: | 0 → 1 |
---|
comment:2 by , 9 years ago
comment:3 by , 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 , 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 , 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.
comment:7 by , 8 years ago
comment:8 by , 8 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
This patch needs to be sent to the ACPICA repo, as we import ACPICA without changes. See https://github.com/acpica/acpica.