Skip to content

Commit

Permalink
rbd: prevent warning about redefining _POSIX_C_SOURCE
Browse files Browse the repository at this point in the history
While building an application with the latest version of go-ceph, the
following warning is spit out:

In file included from _cgo_export.c:4:
resize.go:7: warning: "_POSIX_C_SOURCE" redefined
In file included from /usr/include/bits/libc-header-start.h:33,
                 from /usr/include/stdlib.h:26,
                 from _cgo_export.c:3:
/usr/include/features.h:292: note: this is the location of the previous definition
  292 | # define _POSIX_C_SOURCE        200809L

When _POSIX_C_SOURCE is already defined, ther is no need to define it
again.

Signed-off-by: Niels de Vos <ndevos@ibm.com>
  • Loading branch information
nixpanic authored and mergify[bot] committed Mar 21, 2024
1 parent bb2a449 commit 8d71b1f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions rbd/resize.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ package rbd

/*
#cgo LDFLAGS: -lrbd
#ifndef _POSIX_C_SOURCE
// possibly defined in /usr/include/features.h already
#define _POSIX_C_SOURCE 200112L
#endif
#undef _GNU_SOURCE
#include <errno.h>
#include <stdlib.h>
Expand Down

0 comments on commit 8d71b1f

Please sign in to comment.