Skip to content

Warning: argument -pedantic, forcing local preprocessing - even with -std flag specified #630

@mliszcz

Description

@mliszcz

I noticed this warning with gcc 12.2.0:

ICECC[13224] 2024-03-18 14:34:38: argument -pedantic, forcing local preprocessing (try using -std=cXX instead of -std=gnuXX)

Indeed we have -Wpedantic BUT we also have -std=c++17.

The check is implemented here:

icecream/client/arg.cpp

Lines 891 to 897 in 9d397ef

// -pedantic doesn't work with remote preprocessing, if extensions to a named standard
// are allowed. GCC allows GNU extensions by default, so let's check if a standard
// other than eg gnu11 or gnu++14 was specified.
if( seen_pedantic && !compiler_is_clang(job) && (!standard || str_startswith("gnu", standard)) ) {
log_warning() << "argument -pedantic, forcing local preprocessing (try using -std=cXX instead of -std=gnuXX)" << endl;
job.setBlockRewriteIncludes(true);
}

The standard variable is declared on top but never assigned:

const char *standard = nullptr;

Is remote preprocessing supposed to work as described in the warning message/comment? If yes and it was overlooked, I can send a PR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions