Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
libbsd
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
3
Issues
3
List
Boards
Labels
Service Desk
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
libbsd
libbsd
Commits
574c7a13
Commit
574c7a13
authored
Jun 18, 2018
by
Guillem Jover
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Protect C language extensions with two leading and trailing underscores
This should make their usage safer against user macros.
parent
c2d9d840
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
15 additions
and
12 deletions
+15
-12
configure.ac
configure.ac
+1
-1
include/bsd/sys/cdefs.h
include/bsd/sys/cdefs.h
+5
-5
src/explicit_bzero.c
src/explicit_bzero.c
+1
-1
src/local-link.h
src/local-link.h
+1
-1
src/setproctitle.c
src/setproctitle.c
+6
-3
src/setproctitle_ctor.c
src/setproctitle_ctor.c
+1
-1
No files found.
configure.ac
View file @
574c7a13
...
...
@@ -87,7 +87,7 @@ AC_CACHE_CHECK(
[[
static int rc = 1;
static void init(int argc) { if (argc == 1) rc = 0; }
void (*init_func)(int argc) __attribute__((
section
(".init_array"))) = init;
void (*init_func)(int argc) __attribute__((
__section__
(".init_array"))) = init;
int main() { return rc; }
]]
)],
...
...
include/bsd/sys/cdefs.h
View file @
574c7a13
...
...
@@ -86,9 +86,9 @@
#endif
#if LIBBSD_GCC_VERSION >= 0x0405
#define LIBBSD_DEPRECATED(x) __attribute__((
deprecated
(x)))
#define LIBBSD_DEPRECATED(x) __attribute__((
__deprecated__
(x)))
#elif LIBBSD_GCC_VERSION >= 0x0301
#define LIBBSD_DEPRECATED(x) __attribute__((
deprecated
))
#define LIBBSD_DEPRECATED(x) __attribute__((
__deprecated__
))
#else
#define LIBBSD_DEPRECATED(x)
#endif
...
...
@@ -137,7 +137,7 @@
#if 0
#ifndef __unused
# if LIBBSD_GCC_VERSION >= 0x0300
# define __unused __attribute__((
unused
))
# define __unused __attribute__((
__unused__
))
# else
# define __unused
# endif
...
...
@@ -146,7 +146,7 @@
#ifndef __printflike
# if LIBBSD_GCC_VERSION >= 0x0300
# define __printflike(x, y) __attribute((
format(printf
, (x), (y))))
# define __printflike(x, y) __attribute((
__format__(__printf__
, (x), (y))))
# else
# define __printflike(x, y)
# endif
...
...
@@ -202,7 +202,7 @@
#ifndef __containerof
# if LIBBSD_GCC_VERSION >= 0x0301
# define __containerof(x, s, m) ({ \
const volatile __typeof(((s *)0)->m) *__x = (x); \
const volatile __typeof
__
(((s *)0)->m) *__x = (x); \
__DEQUALIFY(s *, (const volatile char *)__x - __offsetof(s, m)); \
})
# else
...
...
src/explicit_bzero.c
View file @
574c7a13
...
...
@@ -6,7 +6,7 @@
#include <string.h>
__attribute__
((
weak
))
void
__attribute__
((
__weak__
))
void
__explicit_bzero_hook
(
void
*
buf
,
size_t
len
)
{
}
...
...
src/local-link.h
View file @
574c7a13
...
...
@@ -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
src/setproctitle.c
View file @
574c7a13
...
...
@@ -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"
);
src/setproctitle_ctor.c
View file @
574c7a13
...
...
@@ -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
;
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment