Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 4bc4cfe

Browse files
committed
Suppress -Wunused-result warning for strtol().
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>
1 parent 7f61fd1 commit 4bc4cfe

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/backend/utils/adt/dbsize.c

+3-1
Original file line numberDiff line numberDiff line change
@@ -759,13 +759,15 @@ pg_size_bytes(PG_FUNCTION_ARGS)
759759
/* Part (4): optional exponent */
760760
if (*endptr == 'e' || *endptr == 'E')
761761
{
762+
long exponent;
762763
char *cp;
763764

764765
/*
765766
* Note we might one day support EB units, so if what follows 'E'
766767
* isn't a number, just treat it all as a unit to be parsed.
767768
*/
768-
(void) strtol(endptr + 1, &cp, 10);
769+
exponent = strtol(endptr + 1, &cp, 10);
770+
(void) exponent; /* Silence -Wunused-result warnings */
769771
if (cp > endptr + 1)
770772
endptr = cp;
771773
}

0 commit comments

Comments
 (0)