Mercurial > gnulib
annotate lib/explicit_bzero.c @ 40231:9b3c79fdfe0b
strtod: fix clash with strtold
Problem reported for RHEL 5 by Jesse Caldwell (Bug#34817).
* lib/strtod.c (compute_minus_zero, minus_zero):
Simplify by remving the macro / external variable,
and having just a function. User changed. This avoids
the need for an external variable that might clash.
author | Paul Eggert <eggert@cs.ucla.edu> |
---|---|
date | Mon, 11 Mar 2019 16:40:29 -0700 |
parents | b06060465f09 |
children |
rev | line source |
---|---|
19001 | 1 /* Erasure of sensitive data, generic implementation. |
40057
b06060465f09
maint: Run 'make update-copyright'
Paul Eggert <eggert@cs.ucla.edu>
parents:
39887
diff
changeset
|
2 Copyright (C) 2016-2019 Free Software Foundation, Inc. |
19001 | 3 This file is part of the GNU C Library. |
4 | |
5 The GNU C Library is free software; you can redistribute it and/or | |
6 modify it under the terms of the GNU Lesser General Public | |
7 License as published by the Free Software Foundation; either | |
8 version 2.1 of the License, or (at your option) any later version. | |
9 | |
10 The GNU C Library is distributed in the hope that it will be useful, | |
11 but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
13 Lesser General Public License for more details. | |
14 | |
15 You should have received a copy of the GNU Lesser General Public | |
16 License along with the GNU C Library; if not, see | |
19190 | 17 <https://www.gnu.org/licenses/>. */ |
19001 | 18 |
19 /* An assembler implementation of explicit_bzero can be created as an | |
20 assembler alias of an optimized bzero implementation. | |
21 Architecture-specific implementations also need to define | |
22 __explicit_bzero_chk. */ | |
23 | |
24 #if !_LIBC | |
25 # include <config.h> | |
26 #endif | |
27 | |
28 #include <string.h> | |
29 | |
39887
e6ce7ef2af3e
explicit_bzero: Make it possible to namespace the defined symbol.
Bruno Haible <bruno@clisp.org>
parents:
19484
diff
changeset
|
30 #if _LIBC |
19001 | 31 /* glibc-internal users use __explicit_bzero_chk, and explicit_bzero |
32 redirects to that. */ | |
39887
e6ce7ef2af3e
explicit_bzero: Make it possible to namespace the defined symbol.
Bruno Haible <bruno@clisp.org>
parents:
19484
diff
changeset
|
33 # undef explicit_bzero |
e6ce7ef2af3e
explicit_bzero: Make it possible to namespace the defined symbol.
Bruno Haible <bruno@clisp.org>
parents:
19484
diff
changeset
|
34 #endif |
19001 | 35 |
36 /* Set LEN bytes of S to 0. The compiler will not delete a call to | |
37 this function, even if S is dead after the call. */ | |
38 void | |
39 explicit_bzero (void *s, size_t len) | |
40 { | |
41 #ifdef HAVE_EXPLICIT_MEMSET | |
42 explicit_memset (s, 0, len); | |
43 #else | |
44 memset (s, '\0', len); | |
19470
f64a50e6a1c1
explicit_bzero: port to macOS + Clang 9.0.0
Paul Eggert <eggert@cs.ucla.edu>
parents:
19190
diff
changeset
|
45 # if defined __GNUC__ && !defined __clang__ |
19001 | 46 /* Compiler barrier. */ |
47 asm volatile ("" ::: "memory"); | |
48 # endif | |
49 #endif | |
50 } |