-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix compile errors with certain CFLAGS.
#42 reported that with CFLAGS -flto=4 -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing gcc emits errors. Some of them are mistakes when their sources were brought in from PostgreSQL. This commit fixes them. Note that I was not able to suppress some errors at least with my gcc (9.4.0). This may be because gcc bug (false positives) or just a bug with the old gcc, I don't know at this point. Maybe someday revisit this. Discussion: [pgpool-hackers: 4442] Fixing GitHub issue 42 https://www.pgpool.net/pipermail/pgpool-hackers/2024-March/004443.html ../src/include/query_cache/pool_memqcache.h:251:20: warning: type of 'pool_fetch_from_memory_cache' does not match original declaration [-Wlto-type-mismatch] 251 | extern POOL_STATUS pool_fetch_from_memory_cache(POOL_CONNECTION * frontend, | ^ query_cache/pool_memqcache.c:731:1: note: 'pool_fetch_from_memory_cache' was previously declared here 731 | pool_fetch_from_memory_cache(POOL_CONNECTION * frontend, | ^ query_cache/pool_memqcache.c:731:1: note: code may be misoptimized unless '-fno-strict-aliasing' is used ../src/include/utils/palloc.h:64:22: warning: type of 'CurrentMemoryContext' does not match original declaration [-Wlto-type-mismatch] 64 | extern MemoryContext CurrentMemoryContext; | ^ ../../src/utils/mmgr/mcxt.c:40:15: note: 'CurrentMemoryContext' was previously declared here ../../src/utils/mmgr/mcxt.c:40:15: note: code may be misoptimized unless '-fno-strict-aliasing' is used ../src/include/utils/memutils.h:55:22: warning: type of 'TopMemoryContext' does not match original declaration [-Wlto-type-mismatch] 55 | extern MemoryContext TopMemoryContext; | ^ ../../src/utils/mmgr/mcxt.c:46:15: note: 'TopMemoryContext' was previously declared here ../../src/utils/mmgr/mcxt.c:46:15: note: code may be misoptimized unless '-fno-strict-aliasing' is used ../src/include/pool_config.h:646:22: warning: type of 'pool_config' does not match original declaration [-Wlto-type-mismatch] 646 | extern POOL_CONFIG * pool_config; | ^ config/pool_config.l:46:14: note: 'pool_config' was previously declared here 46 | POOL_CONFIG *pool_config = &g_pool_config; /* for legacy reason pointer to the above struct */ | ^ config/pool_config.l:46:14: note: code may be misoptimized unless '-fno-strict-aliasing' is used
- Loading branch information
1 parent
b082cd1
commit dac18c2
Showing
5 changed files
with
22 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters