diff mbox

avoid "redefined" _GNU_SOURCE by defining as 1

Message ID 20170503205007.21976-3-dab21774@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

David Butterfield May 3, 2017, 8:50 p.m. UTC
Avoid "redefined" _GNU_SOURCE compiler warning by defining it in rbd.c the
same way it is defined on the conventional "gcc -D_GNU_SOURCE" command line.

Signed-off-by: David Butterfield <dab21774@gmail.com>
---
 rbd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Mike Christie May 3, 2017, 11:55 p.m. UTC | #1
On 05/03/2017 03:50 PM, David Butterfield wrote:
> Avoid "redefined" _GNU_SOURCE compiler warning by defining it in rbd.c the
> same way it is defined on the conventional "gcc -D_GNU_SOURCE" command line.
> 
> Signed-off-by: David Butterfield <dab21774@gmail.com>
> ---
>  rbd.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/rbd.c b/rbd.c
> index ed50aa5..8f78e54 100644
> --- a/rbd.c
> +++ b/rbd.c
> @@ -14,7 +14,7 @@
>   * under the License.
>   */
>  
> -#define _GNU_SOURCE
> +#define _GNU_SOURCE 1
>  #include <inttypes.h>
>  #include <stddef.h>
>  #include <stdint.h>
> 

_GNU_SOURCE is defined on all the files, so do we need a common fix?

Can we just remove it and add something in CMakeCache.txt like some sort of:

add_definitions(-D_GNU_SOURCE)

--
To unsubscribe from this list: send the line "unsubscribe target-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/rbd.c b/rbd.c
index ed50aa5..8f78e54 100644
--- a/rbd.c
+++ b/rbd.c
@@ -14,7 +14,7 @@ 
  * under the License.
  */
 
-#define _GNU_SOURCE
+#define _GNU_SOURCE 1
 #include <inttypes.h>
 #include <stddef.h>
 #include <stdint.h>