aboutsummaryrefslogtreecommitdiff
path: root/src/include/common
diff options
context:
space:
mode:
authorPeter Eisentraut <peter@eisentraut.org>2025-03-14 07:18:07 +0100
committerPeter Eisentraut <peter@eisentraut.org>2025-03-14 07:18:07 +0100
commit05cbd6cb22d235d2e52ac309266a5fc50053dc16 (patch)
treeb38252b6531fdbc0219443cdd92f40dea6ce10a8 /src/include/common
parent01261fb07888642efa98ba8d4117654bfd2a413d (diff)
downloadpostgresql-05cbd6cb22d235d2e52ac309266a5fc50053dc16.tar.gz
postgresql-05cbd6cb22d235d2e52ac309266a5fc50053dc16.zip
Swap order of extern/static and pg_nodiscard
When pg_nodiscard was first added, the C standard draft had it as a function specifier, and so the code comment about placement was written with that in mind. The final C23 standard has it as an attribute and the placement rules are a bit different for that. Specifically, it needs to be before extern or static. (Or at least both current clang and gcc require that.) So just swap these. (To be clear: The current implementation with gcc attributes doesn't care. This change is just for maximum forward compatibility for non-gcc compilers.) This also keeps the order consistent with the previously introduced pg_noreturn. Also update the code comment to reflect the mentioned developments since its introduction. Reviewed-by: Dagfinn Ilmari Mannsåker <ilmari@ilmari.org> Reviewed-by: Andres Freund <andres@anarazel.de> Discussion: https://www.postgresql.org/message-id/flat/pxr5b3z7jmkpenssra5zroxi7qzzp6eswuggokw64axmdixpnk@zbwxuq7gbbcw
Diffstat (limited to 'src/include/common')
-rw-r--r--src/include/common/base64.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/include/common/base64.h b/src/include/common/base64.h
index b064275bbb4..3f74aa301f0 100644
--- a/src/include/common/base64.h
+++ b/src/include/common/base64.h
@@ -11,8 +11,8 @@
#define BASE64_H
/* base 64 */
-extern pg_nodiscard int pg_b64_encode(const char *src, int len, char *dst, int dstlen);
-extern pg_nodiscard int pg_b64_decode(const char *src, int len, char *dst, int dstlen);
+pg_nodiscard extern int pg_b64_encode(const char *src, int len, char *dst, int dstlen);
+pg_nodiscard extern int pg_b64_decode(const char *src, int len, char *dst, int dstlen);
extern int pg_b64_enc_len(int srclen);
extern int pg_b64_dec_len(int srclen);