https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108224

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
diff --git a/gcc/c-family/known-headers.cc b/gcc/c-family/known-headers.cc
index 9c256173b82..dd4c23e5923 100644
--- a/gcc/c-family/known-headers.cc
+++ b/gcc/c-family/known-headers.cc
@@ -171,6 +171,8 @@ get_stdlib_header_for_name (const char *name, enum stdlib
lib)
     {"getenv", {"<stdlib.h>", "<cstdlib>"} },
     {"malloc", {"<stdlib.h>", "<cstdlib>"} },
     {"realloc", {"<stdlib.h>", "<cstdlib>"} },
+    {"rand", {"<stdlib.h>", "<cstdlib>"} },
+    {"srand", {"<stdlib.h>", "<cstdlib>"} },

     /* <string.h> and <cstring>.  */
     {"memchr", {"<string.h>", "<cstring>"} },


Should be enough for both C and C++.

Reply via email to