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

Lines changed: 3 additions & 1 deletion
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy