Project

General

Profile

Bug #4287

FreeBSD Clang reports warning, libctf

Added by sean bruno almost 7 years ago. Updated over 5 years ago.

Status:
New
Priority:
Low
Assignee:
-
Category:
DTrace
Start date:
2013-11-04
Due date:
% Done:

0%

Estimated time:
Difficulty:
Bite-size
Tags:
needs-triage
Gerrit CR:

Description

Minor warning from clang 3.3:
/home/sbruno/bsd/fbsd_head/cddl/lib/libctf/../../../cddl/contrib/opensolaris/common/ctf/ctf_create.c:68:15: warning: assigning to 'void *' from 'const ctf_header_t *' (aka 'const struct ctf_header *') discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
cts.cts_data = &hdr;

Resolves with the following cast to (void *):

Index: cddl/contrib/opensolaris/common/ctf/ctf_create.c
===================================================================
--- cddl/contrib/opensolaris/common/ctf/ctf_create.c    (revision 257642)
+++ cddl/contrib/opensolaris/common/ctf/ctf_create.c    (working copy)
@@ -65,7 +65,7 @@
     cts.cts_name = _CTF_SECTION;
     cts.cts_type = SHT_PROGBITS;
     cts.cts_flags = 0;
-    cts.cts_data = &hdr;
+    cts.cts_data = (void *)&hdr;
     cts.cts_size = sizeof (hdr);
     cts.cts_entsize = 1;
     cts.cts_offset = 0;

Also available in: Atom PDF