Skip to content

Commit

Permalink
libcextract: ArgvParser: Add -Wno-missing-prototypes
Browse files Browse the repository at this point in the history
Since clang-extract removes the static keyword from the extracted
function, and kernel can enable -Werror, avoid the procedure to stop
because of missing prototype.

Signed-off-by: Marcos Paulo de Souza <mpdesouza@suse.com>
  • Loading branch information
marcosps committed Apr 1, 2024
1 parent 5922198 commit f980715
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions libcextract/ArgvParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,16 @@ ArgvParser::ArgvParser(int argc, char **argv)
void ArgvParser::Insert_Required_Parameters(void)
{
std::vector<const char *> priv_args = {
"-fno-builtin", // clang interposes some glibc functions and then it fails to find the declaration of them.
"-Xclang", "-detailed-preprocessing-record",
"-Wno-unused-variable", // Passes may instroduce unused variables later removed.
// For some reason libtooling do not pass the clang include folder. Pass this then.
"-I/usr/lib64/clang/" STRINGFY_VALUE(CLANG_VERSION_MAJOR) "/include",
"-Wno-gnu-variable-sized-type-not-at-end",
"-Wno-unused-function" // May happen when trying to extract a static function.
"-Wno-missing-prototypes", // We remove the static keyword from the
// extracted function, so disable warnings
// related to it.
"-Wno-unused-function", // May happen when trying to extract a static function.
"-Wno-unused-variable", // Passes may instroduce unused variables later removed.
"-fno-builtin", // clang interposes some glibc functions and then it fails to find the declaration of them.
};

for (const char *arg : priv_args) {
Expand Down

0 comments on commit f980715

Please sign in to comment.