Bug 452218

Summary: Reports implicit declarations despite code compiles without warnings
Product: [Applications] kdevelop Reporter: Norbert <norbertzpilicy>
Component: Problem reporterAssignee: kdevelop-bugs-null
Status: REPORTED ---    
Severity: normal    
Priority: NOR    
Version First Reported In: 5.7.211203   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: Errors visible
Compiles without errors/warnings

Description Norbert 2022-04-03 09:48:26 UTC
SUMMARY
The code is marked as invalid or warnings are listed.

STEPS TO REPRODUCE
1. Insert sample code.
2. Watch the errors
3. Compile code without warnings or errors

OBSERVED RESULT
Lots of errors and warining despite correct includes

EXPECTED RESULT
No warnings or errors

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Arch Linux
KDE Plasma Version: 5.24.3
KDE Frameworks Version: 5.92.0
Qt Version: 5.15.3

ADDITIONAL INFORMATION
Sample code used:
```c
#include <stdio.h>
#include <signal.h>
#include <stdlib.h>

#define SIGNAL SIGUSR1

void action_handler(int sig, siginfo_t *info, void *ucontext) {
    printf("received signal %d\n", sig);
    exit(0);
}

int main(int argc, char** argv) {

    struct sigaction sa;
    sigaction(SIGNAL, NULL, &sa);
    sa.sa_sigaction = action_handler;
    sigaction(SIGNAL, &sa, NULL);

    raise(SIGNAL);

    while(1);

    return 0;
}
```
Comment 1 Norbert 2022-04-03 09:49:33 UTC
Created attachment 147929 [details]
Errors visible
Comment 2 Norbert 2022-04-03 09:50:21 UTC
Created attachment 147930 [details]
Compiles without errors/warnings
Comment 3 Norbert 2022-04-03 14:48:49 UTC
Adding
`#define __USE_POSIX 1`
before
`#include <signal.h>`
sometimes fixes the issue.