From 527cf8651f05d6465a68e49b8cf48fde328c0d46 Mon Sep 17 00:00:00 2001
From: DavidCok <cok@frontiernet.net>
Date: Fri, 7 Jun 2019 09:16:00 +0200
Subject: [PATCH] [Libc] Avoid using the variable name 'template' as it is a
 C++ reserved word

---
 share/libc/stdlib.h                    | 8 ++++----
 tests/libc/oracle/fc_libc.1.res.oracle | 8 ++++----
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/share/libc/stdlib.h b/share/libc/stdlib.h
index 5d8864feeae..5d903a44e9d 100644
--- a/share/libc/stdlib.h
+++ b/share/libc/stdlib.h
@@ -686,14 +686,14 @@ extern int posix_memalign(void **memptr, size_t alignment, size_t size);
 
 /*@
   // missing: requires 'last 6 characters of template must be XXXXXX'
-  // missing: assigns \result, template[0..] \from 'filesystem', 'RNG';
-  requires valid_template: valid_string(template);
-  assigns template[0..] \from \nothing;
+  // missing: assigns \result, templat[0..] \from 'filesystem', 'RNG';
+  requires valid_template: valid_string(templat);
+  assigns templat[0..] \from \nothing;
   assigns \result \from \nothing;
   ensures result_error_or_valid_fd: \result == -1 ||
                                     0 <= \result < __FC_FOPEN_MAX;
  */
-extern int mkstemp(char *template);
+extern int mkstemp(char *templat);
 
 __END_DECLS
 
diff --git a/tests/libc/oracle/fc_libc.1.res.oracle b/tests/libc/oracle/fc_libc.1.res.oracle
index 1aff0685633..ade6066676f 100644
--- a/tests/libc/oracle/fc_libc.1.res.oracle
+++ b/tests/libc/oracle/fc_libc.1.res.oracle
@@ -2146,14 +2146,14 @@ extern size_t wcstombs(char * __restrict s, wchar_t const * __restrict pwcs,
 
 int posix_memalign(void **memptr, size_t alignment, size_t size);
 
-/*@ requires valid_template: valid_string(template);
+/*@ requires valid_template: valid_string(templat);
     ensures
       result_error_or_valid_fd: \result ≡ -1 ∨ (0 ≤ \result < 16);
-    assigns *(template + (0 ..)), \result;
-    assigns *(template + (0 ..)) \from \nothing;
+    assigns *(templat + (0 ..)), \result;
+    assigns *(templat + (0 ..)) \from \nothing;
     assigns \result \from \nothing;
  */
-extern int mkstemp(char *template);
+extern int mkstemp(char *templat);
 
 int glob(char const *pattern, int flags,
          int (*errfunc)(char const *epath, int eerrno), glob_t *pglob)
-- 
GitLab