Skip to content

added an include-what-you-use GitHub Action#3759

Merged
danmar merged 2 commits into
cppcheck-opensource:mainfrom
firewave:ci-iwyu
Feb 1, 2022
Merged

added an include-what-you-use GitHub Action#3759
danmar merged 2 commits into
cppcheck-opensource:mainfrom
firewave:ci-iwyu

Conversation

@firewave
Copy link
Copy Markdown
Collaborator

@firewave firewave commented Jan 26, 2022

I used Kali Linux instead since ubuntu does not use the latest include-what-you-use version.

The // IWYU pragma: keep annotation will also be used by the upcoming IncludeCleaner feature in clangd - see llvm/llvm-project@b673bc3. clangd is integrated with many IDEs.

@firewave firewave force-pushed the ci-iwyu branch 2 times, most recently from 6ddb873 to 13ffd49 Compare January 26, 2022 16:09
@firewave firewave changed the title Ci iwyu Added a include-what-you-use GitHub Action Jan 26, 2022
@firewave firewave changed the title Added a include-what-you-use GitHub Action Added an include-what-you-use GitHub Action Jan 26, 2022
@firewave firewave changed the title Added an include-what-you-use GitHub Action added an include-what-you-use GitHub Action Jan 26, 2022
@firewave firewave force-pushed the ci-iwyu branch 4 times, most recently from b3aa300 to 400ffc7 Compare January 30, 2022 19:00
@firewave
Copy link
Copy Markdown
Collaborator Author

firewave commented Jan 30, 2022

@firewave firewave marked this pull request as ready for review January 30, 2022 19:19
@danmar danmar merged commit 8f7770f into cppcheck-opensource:main Feb 1, 2022
@firewave firewave deleted the ci-iwyu branch February 1, 2022 16:40
Comment thread cli/cppcheckexecutor.cpp
#ifdef __linux__
#include <sys/syscall.h>
#include <sys/types.h>
#include <syscall.h>
Copy link
Copy Markdown

@alejandro-colomar alejandro-colomar May 1, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change is incorrect. I've been improving the man-pages so that the correct includes are more clear; see syscall(2):

SYNOPSIS
       #include <sys/syscall.h>      /* Definition of SYS_* constants */
       #include <unistd.h>

       long syscall(long number, ...);

   Feature Test Macro Requirements for glibc (see feature_test_macros(7)):

       syscall():
           Since glibc 2.19:
               _DEFAULT_SOURCE
           Before glibc 2.19:
               _BSD_SOURCE || _SVID_SOURCE

https://man7.org/linux/man-pages/man2/syscall.2.html

I opened an issue in iwyu(1) regarding that:

include-what-you-use/include-what-you-use#1036

The BSDs also use <sys/syscall.h>:
https://man.openbsd.org/man2/syscall.2
https://www.freebsd.org/cgi/man.cgi?query=syscall&apropos=0&sektion=0&manpath=FreeBSD+13.0-RELEASE+and+Ports&arch=default&format=html

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alejandro-colomar
Thanks for pointing that out. I implicitly addressed this in the refactoring that is #4359.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants