commit 65808e644bb2606c8d93bfa965530062623b8d3e parent f32860489094e6ea1551b713ab543311035ef448 Author: serge-sans-paille <sguelton@mozilla.com> Date: Wed, 7 Jan 2026 09:43:56 +0000 Bug 2008691 - Remove unused <stdarg.h> inclusion and make sure we don't regress on those r=necko-reviewers,media-playback-reviewers,webrtc-reviewers,padenot,kershaw,ng Differential Revision: https://phabricator.services.mozilla.com/D277976 Diffstat:
26 files changed, 10 insertions(+), 30 deletions(-)
diff --git a/dom/bindings/ErrorResult.h b/dom/bindings/ErrorResult.h @@ -25,8 +25,6 @@ #ifndef mozilla_ErrorResult_h #define mozilla_ErrorResult_h -#include <stdarg.h> - #include <new> #include <utility> @@ -381,7 +379,7 @@ class TErrorResult { \ template <int N> \ void MOZ_MUST_RETURN_FROM_CALLER_IF_THIS_IS_ARG Throw##name( \ - const char(&aMessage)[N]) { \ + const char (&aMessage)[N]) { \ ThrowDOMException(err, aMessage); \ } diff --git a/dom/canvas/CanvasUtils.cpp b/dom/canvas/CanvasUtils.cpp @@ -5,7 +5,6 @@ #include "CanvasUtils.h" -#include <stdarg.h> #include <stdlib.h> #include "WebGL2Context.h" diff --git a/dom/canvas/WebGLContext.h b/dom/canvas/WebGLContext.h @@ -6,8 +6,6 @@ #ifndef WEBGLCONTEXT_H_ #define WEBGLCONTEXT_H_ -#include <stdarg.h> - #include <bitset> #include <memory> diff --git a/dom/canvas/WebGLContextUtils.cpp b/dom/canvas/WebGLContextUtils.cpp @@ -5,8 +5,6 @@ #include "WebGLContextUtils.h" -#include <stdarg.h> - #include "GLContext.h" #include "HostWebGLContext.h" #include "WebGLBuffer.h" diff --git a/dom/media/gmp/widevine-adapter/WidevineUtils.cpp b/dom/media/gmp/widevine-adapter/WidevineUtils.cpp @@ -6,7 +6,6 @@ #include "WidevineUtils.h" #include <inttypes.h> -#include <stdarg.h> #include "GMPLog.h" #include "gmp-api/gmp-errors.h" diff --git a/dom/media/webrtc/transport/mdns_service/mdns_service.h b/dom/media/webrtc/transport/mdns_service/mdns_service.h @@ -2,7 +2,6 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#include <cstdarg> #include <cstdint> #include <new> diff --git a/js/src/gc/Statistics.cpp b/js/src/gc/Statistics.cpp @@ -12,7 +12,6 @@ #include <algorithm> #include <cmath> -#include <stdarg.h> #include <stdio.h> #include <type_traits> diff --git a/js/src/jit/CacheIRSpewer.cpp b/js/src/jit/CacheIRSpewer.cpp @@ -8,8 +8,6 @@ #include "mozilla/Sprintf.h" -#include <stdarg.h> - #include "jsapi.h" #include "jsmath.h" diff --git a/js/src/jit/riscv64/disasm/Disasm-riscv64.cpp b/js/src/jit/riscv64/disasm/Disasm-riscv64.cpp @@ -27,7 +27,6 @@ #include "jit/riscv64/disasm/Disasm-riscv64.h" -#include <stdarg.h> #include <stdio.h> #include <string.h> #include <string_view> diff --git a/js/src/jsapi.h b/js/src/jsapi.h @@ -14,7 +14,6 @@ #include "mozilla/TimeStamp.h" #include "mozilla/Variant.h" -#include <stdarg.h> #include <stddef.h> #include <stdint.h> diff --git a/js/xpconnect/loader/mozJSModuleLoader.cpp b/js/xpconnect/loader/mozJSModuleLoader.cpp @@ -10,8 +10,6 @@ #include "mozilla/RefPtr.h" // RefPtr, mozilla::StaticRefPtr #include "mozilla/Utf8.h" // mozilla::Utf8Unit -#include <cstdarg> - #include "mozilla/Logging.h" #include "mozilla/dom/RequestBinding.h" #ifdef ANDROID diff --git a/mozglue/baseprofiler/core/platform-linux-android.cpp b/mozglue/baseprofiler/core/platform-linux-android.cpp @@ -60,7 +60,6 @@ #endif // def __GLIBC__ #include <strings.h> // index #include <errno.h> -#include <stdarg.h> #include "prenv.h" #include "mozilla/PodOperations.h" diff --git a/mozglue/baseprofiler/core/platform-macos.cpp b/mozglue/baseprofiler/core/platform-macos.cpp @@ -25,7 +25,6 @@ #include <sys/syscall.h> #include <sys/types.h> #include <sys/sysctl.h> -#include <stdarg.h> #include <string.h> #include <errno.h> #include <math.h> diff --git a/netwerk/system/win32/nsNotifyAddrListener.cpp b/netwerk/system/win32/nsNotifyAddrListener.cpp @@ -11,7 +11,6 @@ #include <algorithm> #include <vector> -#include <stdarg.h> #include <windef.h> #include <winbase.h> #include <wingdi.h> diff --git a/toolkit/xre/glxtest/glxtest.cpp b/toolkit/xre/glxtest/glxtest.cpp @@ -28,7 +28,6 @@ #include <vector> #include <stdint.h> #include <string.h> -#include <stdarg.h> #include <gdk/gdk.h> #if defined(MOZ_ASAN) || defined(FUZZING) diff --git a/tools/lint/includes/std.py b/tools/lint/includes/std.py @@ -424,6 +424,13 @@ api["type_traits"].extend( ) capi = { + "stdarg.h": [ + "va_list", + "va_arg", + "va_begin", + "va_end", + "ca_copy", + ], "stdio.h": [ # macros "BUFSIZ", diff --git a/tools/profiler/core/memory_hooks.cpp b/tools/profiler/core/memory_hooks.cpp @@ -26,7 +26,6 @@ #include <ctype.h> #include <errno.h> #include <limits.h> -#include <stdarg.h> #include <stdio.h> #include <stdlib.h> #include <string.h> diff --git a/tools/profiler/core/platform-linux-android.cpp b/tools/profiler/core/platform-linux-android.cpp @@ -60,7 +60,6 @@ #endif // def __GLIBC__ #include <strings.h> // index #include <errno.h> -#include <stdarg.h> #include "prenv.h" #include "mozilla/PodOperations.h" diff --git a/tools/profiler/core/platform-macos.cpp b/tools/profiler/core/platform-macos.cpp @@ -25,7 +25,6 @@ #include <sys/syscall.h> #include <sys/types.h> #include <sys/sysctl.h> -#include <stdarg.h> #include <string.h> #include <errno.h> #include <math.h> diff --git a/widget/gtk/GfxInfoUtils.h b/widget/gtk/GfxInfoUtils.h @@ -10,6 +10,8 @@ #define LOG_PIPE 2 +#include <cstdarg> + static bool enable_logging = false; static void log(const char* format, ...) { if (!enable_logging) { diff --git a/widget/gtk/v4l2test/v4l2test.cpp b/widget/gtk/v4l2test/v4l2test.cpp @@ -21,7 +21,6 @@ #include <string.h> #include <getopt.h> #include <stdint.h> -#include <stdarg.h> #if defined(MOZ_ASAN) || defined(FUZZING) # include <signal.h> diff --git a/widget/gtk/vaapitest/vaapitest.cpp b/widget/gtk/vaapitest/vaapitest.cpp @@ -14,7 +14,6 @@ #include <unistd.h> #include <getopt.h> #include <stdint.h> -#include <stdarg.h> #if defined(MOZ_ASAN) || defined(FUZZING) # include <signal.h> diff --git a/xpcom/base/nsCRTGlue.cpp b/xpcom/base/nsCRTGlue.cpp @@ -11,7 +11,6 @@ #include <stdlib.h> #include <string.h> -#include <stdarg.h> #include "mozilla/Sprintf.h" diff --git a/xpcom/base/nsDebug.h b/xpcom/base/nsDebug.h @@ -14,7 +14,6 @@ #include "mozilla/Assertions.h" #include "mozilla/glue/Debug.h" #include "mozilla/Likely.h" -#include <stdarg.h> #ifdef DEBUG # include "mozilla/ErrorNames.h" diff --git a/xpcom/string/nsAString.h b/xpcom/string/nsAString.h @@ -12,7 +12,6 @@ #include "nsStringIterator.h" #include <string.h> -#include <stdarg.h> #include "nsStringFlags.h" #include "nsTStringRepr.h" diff --git a/xpcom/string/nsTextFormatter.h b/xpcom/string/nsTextFormatter.h @@ -31,7 +31,6 @@ ** %g - float */ #include <stdio.h> -#include <stdarg.h> #include "nscore.h" #include "nsString.h" #include "mozilla/Span.h"