Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fix build warnings#652

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
japinli wants to merge4 commits intopostgrespro:master
base:master
Choose a base branch
Loading
fromjapinli:fix-warning
Open

Conversation

japinli
Copy link
Contributor

When I build pg_probackup with PostgreSQL REL_17_STABLE, I encountered the following warning:

$ make USE_PGXS=1 top_srcdir=/home/japin/Codes/pg/REL_17_STABLE -ssrc/utils/file.c: In function ‘fio_gzread’:src/utils/file.c:1687:64: warning: passing argument 2 of ‘fio_read’ discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers] 1687 |                         rc = fio_read(gz->fd, gz->strm.next_in + gz->strm.avail_in,      |                                               ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~src/utils/file.c:1096:24: note: expected ‘void *’ but argument is of type ‘const Bytef *’ {aka ‘const unsigned char *’} 1096 | fio_read(int fd, void* buf, size_t size)      |                  ~~~~~~^~~src/utils/file.c: In function ‘fio_send_file_gz’:src/utils/file.c:2521:28: warning: declaration of ‘hdr’ shadows a previous local [-Wshadow=compatible-local] 2521 |                 fio_header hdr;      |                            ^~~src/utils/file.c:2502:20: note: shadowed declaration is here 2502 |         fio_header hdr;      |                    ^~~src/backup.c: In function ‘do_backup_pg’:src/backup.c:513:17: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]  513 |                 char    from_fullpath[MAXPGPATH];      |                 ^~~~src/catalog.c: In function ‘catalog_get_timelines’:src/catalog.c:1758:31: warning: declaration of ‘tlinfo’ shadows a previous local [-Wshadow=compatible-local] 1758 |                 timelineInfo *tlinfo = parray_get(timelineinfos, i);      |                               ^~~~~~src/catalog.c:1537:23: note: shadowed declaration is here 1537 |         timelineInfo *tlinfo;      |                       ^~~~~~src/catalog.c:1775:31: warning: declaration of ‘tlinfo’ shadows a previous local [-Wshadow=compatible-local] 1775 |                 timelineInfo *tlinfo = parray_get(timelineinfos, i);      |                               ^~~~~~src/catalog.c:1537:23: note: shadowed declaration is here 1537 |         timelineInfo *tlinfo;      |                       ^~~~~~src/catalog.c:1848:31: warning: declaration of ‘tlinfo’ shadows a previous local [-Wshadow=compatible-local] 1848 |                 timelineInfo *tlinfo = parray_get(timelineinfos, i);      |                               ^~~~~~src/catalog.c:1537:23: note: shadowed declaration is here 1537 |         timelineInfo *tlinfo;      |                       ^~~~~~src/catalog.c:2084:31: warning: declaration of ‘tlinfo’ shadows a previous local [-Wshadow=compatible-local] 2084 |                 timelineInfo *tlinfo = parray_get(timelineinfos, i);      |                               ^~~~~~src/catalog.c:1537:23: note: shadowed declaration is here 1537 |         timelineInfo *tlinfo;      |                       ^~~~~~src/stream.c: In function ‘parse_tli_history_buffer’:src/stream.c:595:41: warning: declaration of ‘tli’ shadows a parameter [-Wshadow=compatible-local]  595 |                         TimeLineID      tli;      |                                         ^~~src/stream.c:574:52: note: shadowed declaration is here  574 | parse_tli_history_buffer(char *history, TimeLineID tli)      |                                         ~~~~~~~~~~~^~~src/utils/file.c:1687:26: warning: passing 'const Bytef *' (aka 'const unsigned char *') to parameter of type 'void *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers] 1687 |                         rc = fio_read(gz->fd, gz->strm.next_in + gz->strm.avail_in,      |                                               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~src/utils/file.c:1096:24: note: passing argument to parameter 'buf' here 1096 | fio_read(int fd, void* buf, size_t size)      |                        ^1 warning generated.

This PR tries to fix them.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

1 participant
@japinli

[8]ページ先頭

©2009-2025 Movatter.jp