]> Savannah Git Hosting - gnulib.git/commit
error: don’t evaluate status arg twice
authorPaul Eggert <eggert@cs.ucla.edu>
Tue, 30 May 2023 19:49:20 +0000 (12:49 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Tue, 30 May 2023 21:39:25 +0000 (14:39 -0700)
commit8b21ff255996a518244a5635e36ea58e21f818be
tree2adc3c89475a2d22d88dfb245afdfd69784b41d2
parent3060bc84f6e39a8f7dc122aa7138981120e2897b
error: don’t evaluate status arg twice

This avoids potential issues if the first argument has a side effect.
* lib/error.in.h (__gl_error_call): New macro, which evaluates its
status arg only once, by using a statement expression if GNU C -
the only platform we need to worry about pacifying - and by simply
calling ‘error’ otherwise.
(error, error_at_line): Use it.
ChangeLog
lib/error.in.h