-
Notifications
You must be signed in to change notification settings - Fork 63
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 management #336
Fix management #336
Conversation
Can you fix these in this PR as well ? |
Uhm, interesting, I'm not having such issues on my system with clang:
$ clang --version
clang version 13.0.1 (Red Hat 13.0.1-2.module+el8.6.0+987+d36ea6a1)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
and I was curious about what the failure was. Did you updated the build process?
I've placed a single commit to handle the right size of the string in
the to_string function, which has not been touched in this PR.
Can you check and decide if the commit has to be squashed or moved
back in the commit history?
Luca
…On Tue, Dec 13, 2022 at 12:48 PM Jesper Pedersen ***@***.***> wrote:
src/libpgagroal/configuration.c: In function ‘to_string’:
src/libpgagroal/configuration.c:3816:42: warning: ‘%s’ directive output may be truncated writing between 1 and 128 bytes into a region of size 127 [-Wformat-truncation=]
3816 | snprintf(where, MISC_LENGTH, "\"%s\"", value);
| ^~
src/libpgagroal/configuration.c:3816:10: note: ‘snprintf’ output between 4 and 131 bytes into a destination of size 128
3816 | snprintf(where, MISC_LENGTH, "\"%s\"", value);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/libpgagroal/configuration.c:3812:41: warning: ‘%s’ directive output may be truncated writing between 1 and 128 bytes into a region of size 127 [-Wformat-truncation=]
3812 | snprintf(where, MISC_LENGTH, "'%s'", value);
| ^~
src/libpgagroal/configuration.c:3812:10: note: ‘snprintf’ output between 4 and 131 bytes into a destination of size 128
3812 | snprintf(where, MISC_LENGTH, "'%s'", value);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/libpgagroal/configuration.c:3821:39: warning: ‘snprintf’ output may be truncated before the last format character [-Wformat-truncation=]
3821 | snprintf(where, MISC_LENGTH, "%s", value);
| ^
src/libpgagroal/configuration.c:3821:7: note: ‘snprintf’ output between 1 and 129 bytes into a destination of size 128
3821 | snprintf(where, MISC_LENGTH, "%s", value);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Can you fix these in this PR as well ?
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
GCC 12
clang 15
|
You could use |
@jesperpedersen I'm getting those make errors as well on the latest master after you introduced 61d60f2. I don't think they're specific to this branch. There doesn't seem to be an existing issue for this that I could find, but dropping 61d60f2 allows me to build pgagroal again. |
@brettgoss Yeah, they are on |
We may have to compile with both gcc and clang in order to catch as many errors as we can... |
We could apply, in the meantime, 7b6f7ee to master since it should fix the compiler errors. |
It reported issues as well - see #336 (comment) |
As reported in CI test failures <agroal#336 (comment)> and <agroal#336 (comment)> the system does not compile under GCC 12 with `-Werror` option. This commit fixes the string length problem reported by gcc. Close agroal#337
7b6f7ee
to
a1b364a
Compare
…g key This commit fixes the problem that arise when the user specifies a global key (i.e., one that does not exist in the section [pgagroal]) to the subcommand `config-get`. If the key is not known, an error is thrown. Close agroal#334
This commit introduces a few constants to indicate if the communication over the management socket has failed due to a connection error or because the data received is not valid. So far, only `config-get` returns a different value to indicate invalid data over the socket, but other commands can take advanatge of this too. The `pgagroal-cli` main loop has been refactored to distinguish the new cases, and now it prints the "connection error" message only when the low level function reports such an error. All the functions now return a specific value among those defined. Close agroal#335
As reported in CI test failures <agroal#336 (comment)> and <agroal#336 (comment)> the system does not compile under GCC 12 with `-Werror` option. This commit fixes the string length problem reported by gcc. Close agroal#337
a1b364a
to
8ae6072
Compare
Personally, I would nuke all |
As reported in CI test failures <agroal#336 (comment)> and <agroal#336 (comment)> the system does not compile under GCC 12 with `-Werror` option. This commit fixes the string length problem reported by gcc. The `to_string` internal method used to get a stringify value of a configuration parameter has changed so that now accepts a buffer size. Such size indicates the max length of the destinatiojn buffer and allows the function to do some more checks about what to copy onto the buffer. Close agroal#337
8ae6072
to
a0311d6
Compare
@jesperpedersen I'm not able to find any |
As reported in CI test failures <#336 (comment)> and <#336 (comment)> the system does not compile under GCC 12 with `-Werror` option. This commit fixes the string length problem reported by gcc. The `to_string` internal method used to get a stringify value of a configuration parameter has changed so that now accepts a buffer size. Such size indicates the max length of the destinatiojn buffer and allows the function to do some more checks about what to copy onto the buffer. Close #337
I fixed the atomic part, squashed and merged. Thanks for your contribution ! |
I made append public, and use it to fix the process title warning. CI is happy now with both gcc and clang |
Hello!
|
@vikingUnet What is your compiler version ? |
No description provided.