Fix some warnings for implicit declaration of functions #5
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When running
make
for the different libs I got warnings for implicit declaration of functions.I am not an expert on C/C++, but I understand these are because the source code is not including the declaration of the functions.
So, I searched for the proper header files and modified the source code to include them.
Used dependencies
firmware505
branch of https://github.com/psxdev/ps4sdk (at commit df03b9fd274ec5dabf105a07e6cb9f0bf6685801).Solved implicit declarations
For
libelfloader
:For
libps4link
:For
liborbisAudio
:For
liborbisKeyboard
:Pending implicit declarations
There are two pending implicit declarations that I don't know how to solve properly. These are not solved by this PR:
For
libps4link
:In my attempts of solving these, I figured:
sys/sysctl.h
is already included on source/commands.c:34sys/ptrace.h
is already included on source/commands.c:36sysctl
is on sys/sysctl.h:793 when_KERNEL
is not defined sys/sysctl.h:789ptrace
is on sys/ptrace.h:188 when_KERNEL
is not defined sys/ptrace.h:183_KERNEL
is defined on ps4/kernel.h:3ps4/kernel.h
is included on source/commands.c:27 (beforesys/sysctl.h
andsys/ptrace.h
)Based on this I conclude that including
ps4/kernel.h
beforesys/sysctl.h
andsys/ptrace.h
makessysctl
andptrace
to not be defined.I tried moving the
#include <sys/sysctl.h>
before the#include <ps4/kernel.h>
. This seems to work forsysctl
.I also tried moving the
#include <sys/ptrace.h>
before the#include <ps4/kernel.h>
. But this resulted in 4 errors:For this I figured:
sys/param.h
TRUE
andFALSE
are defined from sys/param.h:101 only when_KERNEL
is defined on sys/param.h:93Based on this I conclude that including
sys/ptrace.h
beforeps4/kernel.h
makesTRUE
andFALSE
to not be defined.I don't see a solution to this problem without modifying
sys/ptrace.h
orps4/kernel.h
.Any ideas?