git.postgresql.org Git - postgresql.git/commitdiff

git projects / postgresql.git / commitdiff
? search:
summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 7f61fd1)
Suppress -Wunused-result warning for strtol().
2016年8月16日 20:14:16 +0000 (16:14 -0400)
2016年8月16日 20:14:16 +0000 (16:14 -0400)
I'm not sure which bozo thought it's a problem to use strtol() only
for its endptr result, but silence the warning using same method
used elsewhere.

Report: <f845d3a6-5328-3e2a-924f-f8e91aa2b6d2@2ndquadrant.com>


diff --git a/src/backend/utils/adt/dbsize.c b/src/backend/utils/adt/dbsize.c
index 0e8a82d6f4dd5ee4bf1110ee00723a5043239f78..3167bad92b0d42ae52d9338009e0dcd7fc063fa1 100644 (file)
--- a/src/backend/utils/adt/dbsize.c
+++ b/src/backend/utils/adt/dbsize.c
@@ -759,13 +759,15 @@ pg_size_bytes(PG_FUNCTION_ARGS)
/* Part (4): optional exponent */
if (*endptr == 'e' || *endptr == 'E')
{
+ long exponent;
char *cp;
/*
* Note we might one day support EB units, so if what follows 'E'
* isn't a number, just treat it all as a unit to be parsed.
*/
- (void) strtol(endptr + 1, &cp, 10);
+ exponent = strtol(endptr + 1, &cp, 10);
+ (void) exponent; /* Silence -Wunused-result warnings */
if (cp > endptr + 1)
endptr = cp;
}
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /