mirror of
https://gitlab.freedesktop.org/libbsd/libbsd.git
synced 2025-10-23 00:08:02 +02:00
Protect C language extensions with two leading and trailing underscores
This should make their usage safer against user macros.
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
|
||||
#include <string.h>
|
||||
|
||||
__attribute__((weak)) void
|
||||
__attribute__((__weak__)) void
|
||||
__explicit_bzero_hook(void *buf, size_t len)
|
||||
{
|
||||
}
|
||||
|
@@ -29,5 +29,5 @@
|
||||
|
||||
#define libbsd_link_warning(symbol, msg) \
|
||||
static const char libbsd_emit_link_warning_##symbol[] \
|
||||
__attribute__((used,section(".gnu.warning." #symbol))) = msg;
|
||||
__attribute__((__used__,__section__(".gnu.warning." #symbol))) = msg;
|
||||
#endif
|
||||
|
@@ -287,9 +287,12 @@ __asm__(".symver setproctitle_impl,setproctitle@@LIBBSD_0.5");
|
||||
* for code linking against that version, and change the default to use the
|
||||
* new version, so that new code depends on the implemented version. */
|
||||
#ifdef HAVE_TYPEOF
|
||||
extern typeof(setproctitle_impl) setproctitle_stub __attribute__((alias("setproctitle_impl")));
|
||||
extern __typeof__(setproctitle_impl)
|
||||
setproctitle_stub
|
||||
__attribute__((__alias__("setproctitle_impl")));
|
||||
#else
|
||||
void setproctitle_stub(const char *fmt, ...)
|
||||
__attribute__((alias("setproctitle_impl")));
|
||||
void
|
||||
setproctitle_stub(const char *fmt, ...)
|
||||
__attribute__((__alias__("setproctitle_impl")));
|
||||
#endif
|
||||
__asm__(".symver setproctitle_stub,setproctitle@LIBBSD_0.2");
|
||||
|
@@ -49,4 +49,4 @@
|
||||
* move them from .ctors to .init_array.
|
||||
*/
|
||||
void (*libbsd_init_func)(int argc, char *argv[], char *envp[])
|
||||
__attribute__((section(".init_array"))) = setproctitle_init;
|
||||
__attribute__((__section__(".init_array"))) = setproctitle_init;
|
||||
|
Reference in New Issue
Block a user