Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix warning- "declaration shadows a previous local" #275

Merged
merged 1 commit into from
Jun 12, 2023

Conversation

sahemant
Copy link
Contributor

@sahemant sahemant commented Jun 9, 2023

entry *schedule local variable is declared twice in ParseSchedule.

src/job_metadata.c: In function ‘ParseSchedule’:
src/job_metadata.c:1526:10: error: declaration of ‘schedule’ shadows a previous local [-Werror=shadow=compatible-local]
1526 | entry *schedule = calloc(sizeof(entry), sizeof(char));
| ^~~~~~~~
src/job_metadata.c:1514:9: note: shadowed declaration is here
1514 | entry *schedule = parse_cron_entry(scheduleText);
| ^~~~~~~~
cc1: all warnings being treated as errors
make: *** [../../src/Makefile.global:949: src/job_metadata.o] Error 1

gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wimplicit-fallthrough=3 -Wcast-function-type -Wshadow=compatible-local -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -Wno-stringop-truncation -g  -ggdb3 -fPIC -fvisibility=hidden -std=c99 -Wall -Wextra -Werror -Wno-unused-parameter -Wno-implicit-fallthrough -Iinclude -I../../src/interfaces/libpq -I. -I. -I../../src/include  -DLOCK_DEBUG -D_GNU_SOURCE -I/usr/include/libxml2   -c -o src/job_metadata.o src/job_metadata.c -MMD -MP -MF .deps/job_metadata.Po
src/job_metadata.c: In function ‘ParseSchedule’:
src/job_metadata.c:1526:10: error: declaration of ‘schedule’ shadows a previous local [-Werror=shadow=compatible-local]
 1526 |   entry *schedule = calloc(sizeof(entry), sizeof(char));
      |          ^~~~~~~~
src/job_metadata.c:1514:9: note: shadowed declaration is here
 1514 |  entry *schedule = parse_cron_entry(scheduleText);
      |         ^~~~~~~~
cc1: all warnings being treated as errors
make: *** [../../src/Makefile.global:949: src/job_metadata.o] Error 1
@sahemant sahemant changed the title fix compiler warning- "declaration shadows a previous local" fix warning- "declaration shadows a previous local" Jun 9, 2023
@marcocitus marcocitus merged commit aa3f722 into citusdata:main Jun 12, 2023
1 check passed
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.

None yet

2 participants