Suppress remaining -Waddress warnings from recent gcc versions.
Still an exercise in satisfying pedants.
This commit is contained in:
parent
aa90e148ca
commit
e331c60ea7
@ -1673,7 +1673,7 @@ evaluate_backtick(void)
|
|||||||
error = true;
|
error = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (PQExpBufferBroken(&cmd_output))
|
if (PQExpBufferDataBroken(cmd_output))
|
||||||
{
|
{
|
||||||
psql_error("%s: out of memory\n", cmd);
|
psql_error("%s: out of memory\n", cmd);
|
||||||
error = true;
|
error = true;
|
||||||
|
@ -829,7 +829,7 @@ PQconndefaults(void)
|
|||||||
PQconninfoOption *connOptions;
|
PQconninfoOption *connOptions;
|
||||||
|
|
||||||
initPQExpBuffer(&errorBuf);
|
initPQExpBuffer(&errorBuf);
|
||||||
if (PQExpBufferBroken(&errorBuf))
|
if (PQExpBufferDataBroken(errorBuf))
|
||||||
return NULL; /* out of memory already :-( */
|
return NULL; /* out of memory already :-( */
|
||||||
connOptions = conninfo_parse("", &errorBuf, true);
|
connOptions = conninfo_parse("", &errorBuf, true);
|
||||||
termPQExpBuffer(&errorBuf);
|
termPQExpBuffer(&errorBuf);
|
||||||
@ -3967,7 +3967,7 @@ PQconninfoParse(const char *conninfo, char **errmsg)
|
|||||||
if (errmsg)
|
if (errmsg)
|
||||||
*errmsg = NULL; /* default */
|
*errmsg = NULL; /* default */
|
||||||
initPQExpBuffer(&errorBuf);
|
initPQExpBuffer(&errorBuf);
|
||||||
if (PQExpBufferBroken(&errorBuf))
|
if (PQExpBufferDataBroken(errorBuf))
|
||||||
return NULL; /* out of memory already :-( */
|
return NULL; /* out of memory already :-( */
|
||||||
connOptions = conninfo_parse(conninfo, &errorBuf, false);
|
connOptions = conninfo_parse(conninfo, &errorBuf, false);
|
||||||
if (connOptions == NULL && errmsg)
|
if (connOptions == NULL && errmsg)
|
||||||
|
@ -59,6 +59,14 @@ typedef PQExpBufferData *PQExpBuffer;
|
|||||||
#define PQExpBufferBroken(str) \
|
#define PQExpBufferBroken(str) \
|
||||||
((str) == NULL || (str)->maxlen == 0)
|
((str) == NULL || (str)->maxlen == 0)
|
||||||
|
|
||||||
|
/*------------------------
|
||||||
|
* Same, but for use when using a static or local PQExpBufferData struct.
|
||||||
|
* For that, a null-pointer test is useless and may draw compiler warnings.
|
||||||
|
*------------------------
|
||||||
|
*/
|
||||||
|
#define PQExpBufferDataBroken(buf) \
|
||||||
|
((buf).maxlen == 0)
|
||||||
|
|
||||||
/*------------------------
|
/*------------------------
|
||||||
* Initial size of the data buffer in a PQExpBuffer.
|
* Initial size of the data buffer in a PQExpBuffer.
|
||||||
* NB: this must be large enough to hold error messages that might
|
* NB: this must be large enough to hold error messages that might
|
||||||
|
Loading…
x
Reference in New Issue
Block a user