What todo with warning - control reaches end of non-void function #7678
SeleznevPavel
started this conversation in
General
Replies: 2 comments
-
|
Hi, Pavel! IMHO, the first solution is preferred, as it is a commonly used approach in the PostgreSQL codebase. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
At the following line
https://github.com/citusdata/citus/blob/main/src/backend/columnar/columnar_tableam.c#L3022
I get warning that prevent build
"columnar_tableam.c:3024:1: error: control reaches end of non-void function"
Treat warnings as error is turned on for the whole project
What is the best way to get around this issue?
Option 1 add fake return
return null
Option 2 put the function into
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wreturn-type"
static char *
AvailableExtensionVersionColumnar(void)
{
....
}
#pragma GCC diagnostic pop
I am planning create pull request with best solition
Beta Was this translation helpful? Give feedback.
All reactions