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 compilation error (-Wstringop-overflow)#68

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

Merged
vitcpp merged 1 commit intopostgrespro:masterfromvitcpp:fix-compilation
Sep 27, 2023

Conversation

vitcpp
Copy link
Contributor

GCC may produce false warnings in some cases when working with strings (char*) when -Wstringop-overflow is enabled. The patch fixes the compilation warning that origins in some tricky pointers casts.

The error message:

g++ -Wall -Wpointer-arith -Wendif-labels -Wmissing-format-attribute -Wimplicit-fallthrough=3 -Wcast-function-type -Wshadow=compatible-local -Wformat-security -fno-strict-aliasing -fwrapv -g -O2 -fPIC -fvisibility=hidden -fvisibility-inlines-hidden -DPGSPHERE_VERSION=1.3.1 -I. -I./ -I/home/vit/p.pgsphere/local/include/postgresql/server -I/home/vit/p.pgsphere/local/include/postgresql/internal -D_GNU_SOURCE -fopenmp -I/usr/include/healpix_cxx -c -o src/process_moc.o src/process_moc.cpp -MMD -MP -MF .deps/process_moc.Po In file included from /usr/include/string.h:535, from /usr/include/c++/11/cstring:42, from src/process_moc.cpp:2: In function ‘void* memmove(void*, const void*, size_t)’, inlined from ‘void rpage_iter<V, page_size, value_size>::set(const V&) [with V = moc_interval; long unsigned int page_size = 1996; long unsigned int value_size = 16]’ at src/process_moc.cpp:336:15, inlined from ‘void create_moc_release_context(void*, Smoc*, pgs_error_handler)’ at src/process_moc.cpp:604:9: /usr/include/x86_64-linux-gnu/bits/string_fortified.h:36:34: warning: writing 16 bytes into a region of size 2 [-Wstringop-overflow=] 36 | return __builtin___memmove_chk (__dest, __src, __len, | ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~ 37 | __glibc_objsize0 (__dest)); | ~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from src/process_moc.cpp:19: src/pgs_process_moc.h: In function ‘void create_moc_release_context(void*, Smoc*, pgs_error_handler)’: src/pgs_process_moc.h:58:25: note: destination object ‘Smoc::version’ of size 2 58 | uint16 version; /* version of the 'toasty' MOC data structure */

GCC may produce false warnings in some cases when working withstrings (char*) when -Wstringop-overflow is enabled. The patch fixesthe compilation warning that origins in some tricky pointers casts.
Copy link
Contributor

@esabolesabol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Nice!

vitcpp reacted with thumbs up emoji
@vitcppvitcpp merged commit74b3304 intopostgrespro:masterSep 27, 2023
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@esabolesabolesabol approved these changes

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@vitcpp@esabol

[8]ページ先頭

©2009-2025 Movatter.jp