Project

General

Profile

Bug #11580

dtrace: cast between incompatible function types

Added by Toomas Soome 6 months ago. Updated 3 months ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
DTrace
Start date:
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:

Description

Build errors with gcc 8:

    ../../common/dtrace/dtrace.c:256:2: error: cast between incompatible function types from 'int (*)(void)' to 'int (*)(void *, dtrace_id_t,  void *)' {aka 'int (*)(void *, unsigned int,  void *)'} [-Werror=cast-function-type]
      (int (*)(void *, dtrace_id_t, void *))dtrace_enable_nullop,
      ^
    ../../common/dtrace/dtrace.c: In function 'dtrace_unregister':
    ../../common/dtrace/dtrace.c:8358:6: error: cast between incompatible function types from 'int (*)(void)' to 'int (*)(void *, dtrace_id_t,  void *)' {aka 'int (*)(void *, unsigned int,  void *)'} [-Werror=cast-function-type]
          (int (*)(void *, dtrace_id_t, void *))dtrace_enable_nullop) {
          ^
    ../../common/dtrace/dtrace.c: In function 'dtrace_attach':
    ../../common/dtrace/dtrace.c:16036:26: error: cast between incompatible function types from 'int (*)(cpu_setup_t,  processorid_t)' {aka 'int (*)(enum <anonymous>,  int)'} to 'int (*)(cpu_setup_t,  int,  void *)' {aka 'int (*)(enum <anonymous>,  int,  void *)'} [-Werror=cast-function-type]
      register_cpu_setup_func((cpu_setup_func_t *)dtrace_cpu_setup, NULL);
                              ^
    ../../common/dtrace/dtrace.c: In function 'dtrace_detach':
    ../../common/dtrace/dtrace.c:17150:28: error: cast between incompatible function types from 'int (*)(cpu_setup_t,  processorid_t)' {aka 'int (*)(enum <anonymous>,  int)'} to 'int (*)(cpu_setup_t,  int,  void *)' {aka 'int (*)(enum <anonymous>,  int,  void *)'} [-Werror=cast-function-type]
      unregister_cpu_setup_func((cpu_setup_func_t *)dtrace_cpu_setup, NULL);
                                ^
    cc1: all warnings being treated as errors

Testing done with run dtest:

==== TEST RESULTS ====

     mode: /usr/sbin/dtrace
   passed: 1265
   failed: 13
    total: 1278
root@beastie:/opt/SUNWdtrt# ./bin/dtfailures 
#   KIND       TEST                            DETAILS
0   cpc        tst.allcpus.ksh                 rm: /var/tmp/dtrace.out.3514: No
1   cpc        tst.genericevent.d              dtrace: failed to compile script
2   cpc        tst.platformevent.ksh           dtrace: failed to compile script
3   ip         tst.ipv4localicmp.ksh           
4   ip         tst.ipv4remoteicmp.ksh          
5   ip         tst.ipv4remotetcp.ksh           
6   ip         tst.ipv4remoteudp.ksh           
7   ip         tst.localtcpstate.ksh           
8   ip         tst.remotetcpstate.ksh          
9   java_api   tst.Bean.ksh                    
10  java_api   tst.MultiAggPrinta.ksh          
11  pragma     tst.temporal.ksh                Usage: head [-qv] [-n lines] [-c
12  cpc        tst.allcpus.ksh                 rm: /var/tmp/dtrace.out.29100: No
13  cpc        tst.genericevent.d              dtrace: failed to compile script
14  cpc        tst.platformevent.ksh           dtrace: failed to compile script
15  ip         tst.ipv4localicmp.ksh           
16  ip         tst.ipv4localtcp.ksh            
17  ip         tst.ipv4remoteicmp.ksh          
18  ip         tst.ipv4remotetcp.ksh           
19  ip         tst.localtcpstate.ksh           
20  ip         tst.remotetcpstate.ksh          
21  java_api   tst.Bean.ksh                    
22  java_api   tst.MultiAggPrinta.ksh          
23  pid        tst.killonerror.ksh             
24  pragma     tst.temporal.ksh                Usage: head [-qv] [-n lines] [-c
25  aggs       tst.subr.d                      argument: void bin failure.0 failure.1 failure.10 failure.11 failure.12 failure.13 failure.14 failure.15 failure.16 failure.17 failure.18 failure.19 failure.2 failure.20 failure.21 failure.22 failure.23 failure.24 failure.25 failure.26 failure.27 failure.28 failure.29 failure.3 failure.30 failure.31 failure.32 failure.33 failure.34 failure.35 failure.36 failure.37 failure.38 failure.39 failure.4 failure.40 failure.41 failure.42 failure.43 failure.44 failure.45 failure.46 failure.47 failure.48 failure.5 failure.6 failure.7 failure.8 failure.9 lib README tst
26  ip         tst.ipv4localicmp.ksh           
27  ip         tst.ipv4localtcp.ksh            
28  ip         tst.ipv4remoteicmp.ksh          
29  ip         tst.ipv4remotetcp.ksh           
30  ip         tst.localtcpstate.ksh           
31  ip         tst.remotetcpstate.ksh          
32  java_api   tst.Bean.ksh                    
33  java_api   tst.MultiAggPrinta.ksh          
34  misc       tst.include.ksh                 
35  pragma     tst.temporal.ksh                Usage: head [-qv] [-n lines] [-c
36  aggs       tst.subr.d                      argument: void bin failure.0 failure.1 failure.10 failure.11 failure.12 failure.13 failure.14 failure.15 failure.16 failure.17 failure.18 failure.19 failure.2 failure.20 failure.21 failure.22 failure.23 failure.24 failure.25 failure.26 failure.27 failure.28 failure.29 failure.3 failure.30 failure.31 failure.32 failure.33 failure.34 failure.35 failure.36 failure.37 failure.38 failure.39 failure.4 failure.40 failure.41 failure.42 failure.43 failure.44 failure.45 failure.46 failure.47 failure.48 failure.5 failure.6 failure.7 failure.8 failure.9 lib README tst
37  funcs      tst.index.d                     dtrace: error on enabled probe ID
38  ip         tst.ipv4localicmp.ksh           
39  ip         tst.ipv4localtcp.ksh            
40  ip         tst.ipv4remoteicmp.ksh          
41  ip         tst.ipv4remotetcp.ksh           
42  ip         tst.ipv4remoteudp.ksh           
43  ip         tst.localtcpstate.ksh           
44  ip         tst.remotetcpstate.ksh          
45  java_api   tst.Bean.ksh                    
46  java_api   tst.MultiAggPrinta.ksh          
47  misc       tst.include.ksh                 
48  pragma     tst.temporal.ksh                Usage: head [-qv] [-n lines] [-c
root@beastie:/opt/SUNWdtrt#

History

#1

Updated by Toomas Soome 3 months ago

  • Description updated (diff)
#2

Updated by Electric Monk 3 months ago

  • Status changed from In Progress to Closed
  • % Done changed from 90 to 100

git commit ed1faac10502dadc7e3eb411d17af6845ecf5d7d

commit  ed1faac10502dadc7e3eb411d17af6845ecf5d7d
Author: Toomas Soome <tsoome@me.com>
Date:   2019-11-17T08:11:21.000Z

    11580 dtrace: cast between incompatible function types
    Reviewed by: C Fraire <cfraire@me.com>
    Approved by: Dan McDonald <danmcd@joyent.com>

Also available in: Atom PDF