commit 9eb9358a1ef702c07b6b7f5df44501a6163f3038 parent 9c4eb6b6153d7f8effbf1ffa478ea56eb90fb4f2 Author: serge-sans-paille <sguelton@mozilla.com> Date: Wed, 7 Jan 2026 06:31:45 +0000 Bug 2007348 - Remove remaining unused <stdlib.h> and <stdio.h> inclusion r=webrtc-reviewers,win-reviewers,toolkit-telemetry-reviewers,gstoll,ng Differential Revision: https://phabricator.services.mozilla.com/D277975 Diffstat:
67 files changed, 0 insertions(+), 74 deletions(-)
diff --git a/build/unix/elfhack/inject.c b/build/unix/elfhack/inject.c @@ -3,7 +3,6 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include <stdint.h> -#include <stdlib.h> #include <unistd.h> #include <sys/mman.h> #include <elf.h> diff --git a/dom/ipc/RefMessageBodyService.cpp b/dom/ipc/RefMessageBodyService.cpp @@ -7,7 +7,6 @@ #include "RefMessageBodyService.h" #include <cstdint> -#include <cstdlib> #include "mozilla/ErrorResult.h" #include "mozilla/RefPtr.h" diff --git a/dom/localstorage/LSSnapshot.cpp b/dom/localstorage/LSSnapshot.cpp @@ -15,7 +15,6 @@ // Global includes #include <cstdint> -#include <cstdlib> #include <new> #include <utility> diff --git a/dom/localstorage/LSSnapshot.h b/dom/localstorage/LSSnapshot.h @@ -8,7 +8,6 @@ #define mozilla_dom_localstorage_LSSnapshot_h #include <cstdint> -#include <cstdlib> #include "ErrorList.h" #include "mozilla/Assertions.h" diff --git a/dom/media/webrtc/sdp/RsdparsaSdp.cpp b/dom/media/webrtc/sdp/RsdparsaSdp.cpp @@ -6,8 +6,6 @@ #include "sdp/RsdparsaSdp.h" -#include <cstdlib> - #include "mozilla/Assertions.h" #include "nsError.h" #include "sdp/RsdparsaSdpInc.h" diff --git a/dom/media/webrtc/transport/mdns_service/mdns_service.h b/dom/media/webrtc/transport/mdns_service/mdns_service.h @@ -4,7 +4,6 @@ #include <cstdarg> #include <cstdint> -#include <cstdlib> #include <new> struct MDNSService; diff --git a/dom/media/webspeech/synth/SpeechSynthesisUtterance.cpp b/dom/media/webspeech/synth/SpeechSynthesisUtterance.cpp @@ -6,8 +6,6 @@ #include "SpeechSynthesisUtterance.h" -#include <stdlib.h> - #include "SpeechSynthesisVoice.h" #include "mozilla/dom/SpeechSynthesisEvent.h" #include "mozilla/dom/SpeechSynthesisUtteranceBinding.h" diff --git a/dom/media/webspeech/synth/speechd/SpeechDispatcherService.cpp b/dom/media/webspeech/synth/speechd/SpeechDispatcherService.cpp @@ -7,7 +7,6 @@ #include "SpeechDispatcherService.h" #include <math.h> -#include <stdlib.h> #include "mozilla/ClearOnShutdown.h" #include "mozilla/Preferences.h" diff --git a/dom/quota/test/gtest/TestEncryptedStream.cpp b/dom/quota/test/gtest/TestEncryptedStream.cpp @@ -6,7 +6,6 @@ #include <algorithm> #include <cstdint> -#include <cstdlib> #include <new> #include <numeric> #include <ostream> diff --git a/dom/security/test/gtest/TestFilenameEvalParser.cpp b/dom/security/test/gtest/TestFilenameEvalParser.cpp @@ -4,7 +4,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 <stdlib.h> #include <string.h> #include "gtest/gtest.h" diff --git a/dom/security/test/gtest/TestSecureContext.cpp b/dom/security/test/gtest/TestSecureContext.cpp @@ -4,7 +4,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 <stdlib.h> #include <string.h> #include "gtest/gtest.h" diff --git a/dom/security/test/gtest/TestSmartCrashTrimmer.cpp b/dom/security/test/gtest/TestSmartCrashTrimmer.cpp @@ -5,7 +5,6 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include <stdio.h> -#include <stdlib.h> #include <string.h> #include "gtest/gtest.h" diff --git a/dom/security/test/gtest/TestUnexpectedPrivilegedLoads.cpp b/dom/security/test/gtest/TestUnexpectedPrivilegedLoads.cpp @@ -4,7 +4,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 <stdlib.h> #include <string.h> #include "TelemetryFixture.h" diff --git a/dom/simpledb/ActorsParent.cpp b/dom/simpledb/ActorsParent.cpp @@ -11,7 +11,6 @@ // Global includes #include <cstdint> -#include <cstdlib> #include <new> #include <utility> diff --git a/dom/xslt/base/txDouble.cpp b/dom/xslt/base/txDouble.cpp @@ -4,7 +4,6 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include <math.h> -#include <stdlib.h> #include <algorithm> diff --git a/extensions/spellcheck/hunspell/glue/mozHunspell.cpp b/extensions/spellcheck/hunspell/glue/mozHunspell.cpp @@ -74,7 +74,6 @@ #include "mozilla/Services.h" #include "mozilla/dom/ContentParent_NotifyUpdatedDictionaries.h" -#include <stdlib.h> #include <tuple> using namespace mozilla; diff --git a/gfx/src/FontPropertyTypes.h b/gfx/src/FontPropertyTypes.h @@ -14,7 +14,6 @@ #include <utility> #include <ctype.h> -#include <stdlib.h> #include <string.h> #include "mozilla/Assertions.h" diff --git a/image/decoders/icon/android/nsIconChannel.cpp b/image/decoders/icon/android/nsIconChannel.cpp @@ -3,7 +3,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 <stdlib.h> #include "mozilla/gfx/Swizzle.h" #include "mozilla/dom/ContentChild.h" #include "mozilla/NullPrincipal.h" diff --git a/image/decoders/nsICODecoder.cpp b/image/decoders/nsICODecoder.cpp @@ -8,8 +8,6 @@ #include "nsICODecoder.h" -#include <stdlib.h> - #include <utility> #include "RasterImage.h" diff --git a/intl/lwbrk/rulebrk.c b/intl/lwbrk/rulebrk.c @@ -3,7 +3,6 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #define TH_UNICODE -#include <stdlib.h> #include <stdint.h> #include <assert.h> #include "th_char.h" diff --git a/ipc/glue/IPCMessageUtilsSpecializations.h b/ipc/glue/IPCMessageUtilsSpecializations.h @@ -8,7 +8,6 @@ #define __IPC_GLUE_IPCMESSAGEUTILSSPECIALIZATIONS_H__ #include <cstdint> -#include <cstdlib> #include <limits> #include <set> #include <type_traits> diff --git a/ipc/glue/SerializedStructuredCloneBuffer.h b/ipc/glue/SerializedStructuredCloneBuffer.h @@ -8,7 +8,6 @@ #define __IPC_GLUE_SERIALIZEDSTRUCTUREDCLONEBUFFER_H__ #include <cstdint> -#include <cstdlib> #include "chrome/common/ipc_message.h" #include "chrome/common/ipc_message_utils.h" #include "js/AllocPolicy.h" diff --git a/js/src/builtin/ReflectParse.cpp b/js/src/builtin/ReflectParse.cpp @@ -8,7 +8,6 @@ #include "mozilla/DebugOnly.h" -#include <stdlib.h> #include <utility> #include "jspubtd.h" diff --git a/js/src/debugger/DebuggerMemory.cpp b/js/src/debugger/DebuggerMemory.cpp @@ -6,8 +6,6 @@ #include "debugger/DebuggerMemory.h" -#include <stdlib.h> - #include "jsapi.h" #include "builtin/MapObject.h" diff --git a/js/src/jsapi-tests/testAssemblerBuffer.cpp b/js/src/jsapi-tests/testAssemblerBuffer.cpp @@ -2,8 +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 <stdlib.h> - #include "jit/shared/IonAssemblerBufferWithConstantPools.h" #include "jsapi-tests/tests.h" diff --git a/js/src/jsapi-tests/testWasmLEB128.cpp b/js/src/jsapi-tests/testWasmLEB128.cpp @@ -2,8 +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 <stdlib.h> - #include "jsapi-tests/tests.h" #include "wasm/WasmValidate.h" diff --git a/js/src/threading/noop/ThreadPlatformData.h b/js/src/threading/noop/ThreadPlatformData.h @@ -7,7 +7,6 @@ #ifndef threading_noop_ThreadPlatformData_h #define threading_noop_ThreadPlatformData_h -#include <stdlib.h> #include <string.h> #include "threading/Thread.h" diff --git a/js/src/threading/posix/ThreadPlatformData.h b/js/src/threading/posix/ThreadPlatformData.h @@ -8,7 +8,6 @@ #define threading_posix_PlatformData_h #include <pthread.h> -#include <stdlib.h> #include <string.h> #if defined(__APPLE__) && defined(__MACH__) diff --git a/media/mozva/mozva.c b/media/mozva/mozva.c @@ -11,7 +11,6 @@ #include <dlfcn.h> #include <pthread.h> -#include <stdlib.h> #define GET_FUNC(func, lib) (func##Fn = dlsym(lib, #func)) diff --git a/memory/build/Fallback.cpp b/memory/build/Fallback.cpp @@ -6,7 +6,6 @@ #include "mozmemory.h" #include "mozjemalloc.h" -#include <stdlib.h> #ifndef HAVE_MEMALIGN MOZ_MEMORY_API void* memalign(size_t aAlignment, size_t aSize) { diff --git a/memory/mozjemalloc_info/MozjemallocInfo.cpp b/memory/mozjemalloc_info/MozjemallocInfo.cpp @@ -5,7 +5,6 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include <stdio.h> -#include <stdlib.h> #include "mozmemory.h" diff --git a/mfbt/EndianUtils.h b/mfbt/EndianUtils.h @@ -73,7 +73,6 @@ #include <string.h> #if defined(_MSC_VER) -# include <stdlib.h> # pragma intrinsic(_byteswap_ushort) # pragma intrinsic(_byteswap_ulong) # pragma intrinsic(_byteswap_uint64) diff --git a/mfbt/RandomNum.cpp b/mfbt/RandomNum.cpp @@ -30,7 +30,6 @@ extern "C" BOOLEAN NTAPI RtlGenRandom(PVOID RandomBuffer, #if defined(ANDROID) || defined(XP_DARWIN) || defined(__DragonFly__) || \ defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || \ defined(__wasi__) -# include <stdlib.h> # define USE_ARC4RANDOM #endif diff --git a/modules/libmar/src/mar_extract.c b/modules/libmar/src/mar_extract.c @@ -8,7 +8,6 @@ #include <sys/stat.h> #include <fcntl.h> #include <string.h> -#include <stdlib.h> #include "mar_private.h" #include "mar.h" diff --git a/mozglue/baseprofiler/core/platform-macos.cpp b/mozglue/baseprofiler/core/platform-macos.cpp @@ -26,7 +26,6 @@ #include <sys/types.h> #include <sys/sysctl.h> #include <stdarg.h> -#include <stdlib.h> #include <string.h> #include <errno.h> #include <math.h> diff --git a/mozglue/baseprofiler/core/shared-libraries-macos.cc b/mozglue/baseprofiler/core/shared-libraries-macos.cc @@ -19,7 +19,6 @@ #include <mach/task_info.h> #include <mach/task.h> #include <sstream> -#include <stdlib.h> #include <string.h> #include <vector> diff --git a/mozglue/baseprofiler/public/SharedLibraries.h b/mozglue/baseprofiler/public/SharedLibraries.h @@ -11,7 +11,6 @@ #include <algorithm> #include <stdint.h> -#include <stdlib.h> #include <string> #include <vector> #include <tuple> diff --git a/mozglue/build/mips.cpp b/mozglue/build/mips.cpp @@ -7,7 +7,6 @@ #include "mips.h" #include <stdio.h> -#include <stdlib.h> #include <string.h> enum { diff --git a/mozglue/interposers/pthread_atfork_interposer.cpp b/mozglue/interposers/pthread_atfork_interposer.cpp @@ -5,7 +5,6 @@ #include <atomic> #include <array> #include <errno.h> -#include <stdlib.h> #include "mozilla/Assertions.h" #include "mozilla/DebugOnly.h" diff --git a/mozglue/misc/ConditionVariable_windows.cpp b/mozglue/misc/ConditionVariable_windows.cpp @@ -8,7 +8,6 @@ #include <float.h> #include <intrin.h> -#include <stdlib.h> #include <windows.h> #include "mozilla/PlatformConditionVariable.h" diff --git a/netwerk/protocol/http/nsHttpAuthCache.cpp b/netwerk/protocol/http/nsHttpAuthCache.cpp @@ -9,7 +9,6 @@ #include "nsHttpAuthCache.h" #include <algorithm> -#include <stdlib.h> #include "nsString.h" #include "nsCRT.h" diff --git a/netwerk/sctp/datachannel/DataChannel.cpp b/netwerk/sctp/datachannel/DataChannel.cpp @@ -6,7 +6,6 @@ #include <algorithm> #include <stdio.h> -#include <stdlib.h> #ifdef XP_WIN # include <winsock.h> // for htonl, htons, ntohl, ntohs diff --git a/netwerk/test/gtest/TestCommon.h b/netwerk/test/gtest/TestCommon.h @@ -5,7 +5,6 @@ #ifndef TestCommon_h__ #define TestCommon_h__ -#include <stdlib.h> #include "nsThreadUtils.h" #include "mozilla/SpinEventLoopUntil.h" diff --git a/security/sandbox/linux/SandboxHooks.cpp b/security/sandbox/linux/SandboxHooks.cpp @@ -12,7 +12,6 @@ #include <signal.h> #include <errno.h> #include <stdio.h> -#include <stdlib.h> #include <sys/inotify.h> #ifdef MOZ_X11 # include <X11/Xlib.h> diff --git a/toolkit/components/backgroundhangmonitor/ThreadStackHelper.cpp b/toolkit/components/backgroundhangmonitor/ThreadStackHelper.cpp @@ -33,7 +33,6 @@ #endif #include <string.h> -#include <cstdlib> #ifdef XP_LINUX # include <ucontext.h> diff --git a/toolkit/components/maintenanceservice/serviceinstall.cpp b/toolkit/components/maintenanceservice/serviceinstall.cpp @@ -4,7 +4,6 @@ #include <windows.h> #include <aclapi.h> -#include <stdlib.h> #include <shlwapi.h> // Used for DNLEN and UNLEN diff --git a/toolkit/components/remote/RemoteUtils.cpp b/toolkit/components/remote/RemoteUtils.cpp @@ -6,7 +6,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 <stdlib.h> #include <string.h> #include <unistd.h> #include <limits.h> diff --git a/toolkit/components/telemetry/pingsender/pingsender.cpp b/toolkit/components/telemetry/pingsender/pingsender.cpp @@ -3,7 +3,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 <cstdlib> #include <cstdint> #include <cstring> #include <ctime> diff --git a/toolkit/mozapps/extensions/AddonManagerStartup.cpp b/toolkit/mozapps/extensions/AddonManagerStartup.cpp @@ -46,8 +46,6 @@ #include "nsReadableUtils.h" #include "nsXULAppAPI.h" -#include <stdlib.h> - namespace mozilla { using Compression::LZ4; diff --git a/toolkit/tests/gtest/TestXREAppDir.cpp b/toolkit/tests/gtest/TestXREAppDir.cpp @@ -21,7 +21,6 @@ #include "nsPrintfCString.h" #if defined(XP_UNIX) -# include <stdlib.h> # include <unistd.h> # include <sys/stat.h> #endif // XP_UNIX diff --git a/toolkit/xre/MacRunFromDmgUtils.mm b/toolkit/xre/MacRunFromDmgUtils.mm @@ -8,7 +8,6 @@ #include <CoreFoundation/CoreFoundation.h> #include <CoreServices/CoreServices.h> #include <IOKit/IOKitLib.h> -#include <stdlib.h> #include <string.h> #include <sys/mount.h> #include <sys/param.h> diff --git a/tools/clang-tidy/test/clang-analyzer-security.insecureAPI.rand.cpp b/tools/clang-tidy/test/clang-analyzer-security.insecureAPI.rand.cpp @@ -1,4 +1,3 @@ -#include <stdlib.h> void test() { random(); } diff --git a/tools/profiler/core/PowerCounters-linux.cpp b/tools/profiler/core/PowerCounters-linux.cpp @@ -14,7 +14,6 @@ #include <cerrno> #include <cinttypes> #include <cstdio> -#include <cstdlib> #include <fstream> #include <string> diff --git a/tools/profiler/core/ProfileBufferEntry.h b/tools/profiler/core/ProfileBufferEntry.h @@ -8,7 +8,6 @@ #define ProfileBufferEntry_h #include <cstdint> -#include <cstdlib> #include <functional> #include <type_traits> #include "gtest/MozGtestFriend.h" diff --git a/tools/profiler/core/platform-macos.cpp b/tools/profiler/core/platform-macos.cpp @@ -26,7 +26,6 @@ #include <sys/types.h> #include <sys/sysctl.h> #include <stdarg.h> -#include <stdlib.h> #include <string.h> #include <errno.h> #include <math.h> diff --git a/tools/profiler/lul/LulElfInt.h b/tools/profiler/lul/LulElfInt.h @@ -44,7 +44,6 @@ // should not be included outside of LulElf.cpp. #include <elf.h> -#include <stdlib.h> #include "mozilla/Assertions.h" diff --git a/widget/gtk/mozwayland/mozwayland.c b/widget/gtk/mozwayland/mozwayland.c @@ -5,7 +5,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 <stdlib.h> #include "mozilla/Types.h" #include <gtk/gtk.h> #include <gtk/gtkx.h> diff --git a/widget/gtk/nsClipboardWayland.cpp b/widget/gtk/nsClipboardWayland.cpp @@ -12,7 +12,6 @@ #include "prtime.h" #include <gtk/gtk.h> -#include <stdlib.h> #include <string.h> using namespace mozilla; diff --git a/widget/gtk/nsPrintSettingsGTK.cpp b/widget/gtk/nsPrintSettingsGTK.cpp @@ -6,7 +6,6 @@ #include "nsPrintSettingsGTK.h" #include "nsIFile.h" #include "nsNetUtil.h" -#include <stdlib.h> // These constants are the the strings that GTK expects as key-value pairs for // setting CUPS duplex modes. These are not universal to all CUPS systems, which diff --git a/widget/gtk/wayland/kde-appmenu-protocol.c b/widget/gtk/wayland/kde-appmenu-protocol.c @@ -7,7 +7,6 @@ */ #include <stdbool.h> -#include <stdlib.h> #include <stdint.h> #include "wayland-util.h" diff --git a/widget/gtk/wayland/pointer-gestures-unstable-v1-protocol.c b/widget/gtk/wayland/pointer-gestures-unstable-v1-protocol.c @@ -1,6 +1,5 @@ /* Generated by wayland-scanner 1.22.0 */ -#include <stdlib.h> #include <stdint.h> #include "wayland-util.h" diff --git a/widget/windows/WinHeaderOnlyUtils.h b/widget/windows/WinHeaderOnlyUtils.h @@ -14,7 +14,6 @@ #include <objbase.h> #include <shlwapi.h> #undef ParseURL -#include <stdlib.h> #include <tuple> #include "mozilla/Assertions.h" diff --git a/xpcom/io/nsAppFileLocationProvider.cpp b/xpcom/io/nsAppFileLocationProvider.cpp @@ -25,7 +25,6 @@ # include <shlobj.h> #elif defined(XP_UNIX) # include <unistd.h> -# include <stdlib.h> # include <sys/param.h> #endif diff --git a/xpcom/reflect/xptcall/md/unix/xptcstubs_ipf64.cpp b/xpcom/reflect/xptcall/md/unix/xptcstubs_ipf64.cpp @@ -9,7 +9,6 @@ #include "xptcprivate.h" #include <stddef.h> -#include <stdlib.h> #include <stdint.h> // "This code is for IA64 only" diff --git a/xpcom/tests/gtest/TestCRT.cpp b/xpcom/tests/gtest/TestCRT.cpp @@ -7,7 +7,6 @@ #include "nsCRT.h" #include "nsString.h" #include "plstr.h" -#include <stdlib.h> #include "gtest/gtest.h" namespace TestCRT { diff --git a/xpcom/tests/gtest/TestStorageStream.cpp b/xpcom/tests/gtest/TestStorageStream.cpp @@ -4,7 +4,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 <stdlib.h> #include "gtest/gtest.h" #include "Helpers.h" #include "mozilla/gtest/MozAssertions.h" diff --git a/xpcom/tests/gtest/TestThreads.cpp b/xpcom/tests/gtest/TestThreads.cpp @@ -6,7 +6,6 @@ #include "nsThreadUtils.h" #include <stdio.h> -#include <stdlib.h> #include <memory> #include "nspr.h" #include "nsCOMPtr.h"