OpenAFS Master Repository branch, master, updated. openafs-devel-1_9_2-532-gb545979
Gerrit Code Review
gerrit@openafs.org
Tue, 14 Jul 2026 15:02:26 -0400
The following commit has been merged in the master branch:
commit b54597966494835159f4011077876c5ca1a74006
Author: Andrew Deason <adeason@sinenomine.net>
Date: Tue Jul 14 09:49:04 2026 -0500
config: Introduce AFS_NONNULL_ALL
Since commit 342be35354 (stds.h: introduce AFS_NONNULL), AFS_NONNULL()
is invoked in two ways:
- AFS_NONNULL() says all pointer arguments to a function must be
non-NULL.
- AFS_NONNULL((x,y,...)) says that only arguments x, y, etc. to a
function must be non-NULL.
Invoking AFS_NONNULL with no arguments (or an empty argument) raises a
warning on some platforms, such as WINNT, since the macro is defined to
take a single argument. This causes problems when we are building with
/WX, since these warnings get turned into errors and break the build.
For example:
cl [...] /c c_ident.cpp
c_ident.cpp
cl : Command line warning D9025 : overriding '/W4' with '/W3'
...\include\afs/opr.h(104) : error C2220: warning treated as error - no 'object' file generated
...\include\afs/opr.h(104) : warning C4003: not enough actual parameters for macro 'AFS_NONNULL'
...\include\afs/opr.h(105) : warning C4003: not enough actual parameters for macro 'AFS_NONNULL'
NMAKE : fatal error U1077: 'C:\PROGRA~2\MICROS~1.0\VC\bin\amd64\cl.EXE' : return code '0x2'
Stop.
This issue does not currently break the build, since all objects built
with /WX on WINNT appear to not include any headers that invoke
AFS_NONNULL(). But future commits may do so.
To avoid this, introduce the macro AFS_NONNULL_ALL, which replaces
AFS_NONNULL() passed with no arguments. Add some comments to explain the
macros.
While this could be avoided by suppressing warnings or playing games
with varargs macros or other approaches, using separate macros for these
two variants should be more straightforward and more likely to avoid
platform-specific issues like this.
Also adjust all users of AFS_NONNULL() with no arguments to use
AFS_NONNULL_ALL instead. Adjusting the callers was automated with this
command:
$ git grep -l -F 'AFS_NONNULL()' | xargs sed -i -e 's/AFS_NONNULL()/AFS_NONNULL_ALL/g'
Change-Id: Ie064e943ffa194ca78302cf9120a55c5771bb46d
Reviewed-on: https://gerrit.openafs.org/16879
Reviewed-by: Marcio Brito Barbosa <mbarbosa@sinenomine.net>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Tested-by: Michael Meffie <mmeffie@sinenomine.net>
src/config/stds.h | 10 ++++++++++
src/opr/opr.h | 4 ++--
src/ptserver/ptserver.h | 2 +-
src/ptserver/ptuser.h | 46 +++++++++++++++++++++++-----------------------
src/rxgk/rxgk.h | 28 ++++++++++++++--------------
5 files changed, 50 insertions(+), 40 deletions(-)
--
OpenAFS Master Repository