Skip to content

gcc -Wshadow produces a warning #55

Description

@freeekanayaka

I get a warning when compiling munit.c with gcc -Wshadow (GCC version 7.4.0, but happens consistently with higher versions too).

$ gcc -c -Wshadow -fpic munit.c
munit.c: In function ‘munit_test_runner_run_test_with_params’:
munit.c:1426:24: warning: declaration of ‘orig_stderr’ shadows a previous local [-Wshadow]
     const volatile int orig_stderr = munit_replace_stderr(stderr_buf);
                        ^~~~~~~~~~~
munit.c:1299:7: note: shadowed declaration is here
   int orig_stderr;
       ^~~~~~~~~~~

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions