Cevelop / Issues

The official issue tracker for Cevelop.
9 stars 1 forks source link

constificator: flags unnamed function arguments #6

Closed arvidn closed 7 years ago

arvidn commented 7 years ago

Expected Behavior

I would expect to constificator to not recommend making undeclared arguments const. consider the following example:

int f(int); // declaration in header file

int f(int) {} // definition in cpp file

The parameter to f is not used by in the function body, and so the argument is not declared. Whether it's const or not is not relevant, because there's no name associated with it. I would not expect constificator to recommend adding const to the function definition in the above example.

Actual Behavior

Constificator flags the above example as missing const.

My specific case where this happens is an assert function in release build:

void assert_fail(char const*, int, char const*
    , char const*, char const*, int) {}

Every argument to this function is flagged as needing a top-level const.

Cevelop Version, Operating System and Compiler

MacOS X, Version: 1.6.0-201701201507

PeterSommerlad commented 7 years ago

Thanks for this bug report. It is something we will fix for the next release and it should be trivial to implement.

fmorgner commented 7 years ago

Thanks for your report @arvidn! Fixed in upstream master. Scheduled for next release.