ANNOUNCEMENT: Live Wireshark University & Allegro Packets online APAC Wireshark Training Session
April 17th, 2024 | 14:30-16:00 SGT (UTC+8) | Online

Wireshark-bugs: [Wireshark-bugs] [Bug 7215] New: dvb-ci: fix some clang warnings

Date: Sun, 29 Apr 2012 11:14:01 -0700 (PDT)
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7215

           Summary: dvb-ci: fix some clang warnings
           Product: Wireshark
           Version: SVN
          Platform: x86
        OS/Version: All
            Status: NEW
          Severity: Minor
          Priority: Low
         Component: Wireshark
        AssignedTo: bugzilla-admin@xxxxxxxxxxxxx
        ReportedBy: wireshark@xxxxxxxxx


Build Information:
Paste the COMPLETE build information from "Help->About Wireshark", "wireshark
-v", or "tshark -v".
--
Dear all,

the attached patch fixes some clang warnings in the DVB-CI dissector

    packet-dvbci.c:1925:16: warning: request for implicit conversion from
    'gpointer' to 'unsigned char *' not permitted in C++ [-Wc++-compat]

    packet-dvbci.c:3685:22: warning: cast from function call of type 'void *'
to
    non-matching type 'long unsigned int' [-Wbad-function-cast]
    packet-dvbci.c:3862:27: warning: cast from function call of type 'void *'
to
    non-matching type 'long unsigned int' [-Wbad-function-cast]

    packet-dvbci.c:5232:29: warning: cast discards '__attribute__((const))'
    qualifier from pointer target type [-Wcast-qual]
    packet-dvbci.c:5239:29: warning: cast discards '__attribute__((const))'
    qualifier from pointer target type [-Wcast-qual]


There's 3 more warnings where I'm not sure how to deal with them

packet-dvbci.c:4407:1: warning: no previous prototype for
'proto_register_dvbci' [-Wmissing-prototypes]

-> Where should this prototype go? Can you point me to a protocol that sets the
prototype correctly?

packet-dvbci.c:5254:38: warning: to be safe all intermediate pointers in cast
from 'gchar **' to 'const gchar **' must be 'const' qualified [-Wcast-qual]

That's about 
    prefs_register_string_preference(dvbci_module,
    "sek", "SAC Encryption Key", "SAC Encryption Key (16 hex bytes)",
    (const gchar **)&dvbci_sek);

with 

static gchar* dvbci_sek = NULL;

Apparently, it can't be &((const gchar *)dvbci_sek), but what else?

Best regards,

  Martin

-- 
Configure bugmail: https://bugs.wireshark.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching all bug changes.