[Openais] corosync lint stats

angus salkeld angus.salkeld at alliedtelesis.co.nz
Sun Nov 2 16:44:10 PST 2008


Hi

There is a LOT of warning related to the different error enums (SaAisErrorT, confdb_error_t, ..._)

Why do we have all of these instead of one (SaAisErrorT) or at most two (SaAisErrorT and corosync_erorr_t)?

Regards
Angus

Here are some lint stats:

make lint > lint.txt 2>&1

Total number of lint warnings
-----------------------
cat lint.txt | grep -v ".c: (in function" | grep ".c:" | wc -l
487

Summary of warning types
---------------------
cat lint.txt | grep -v ".c: (in function" | grep ".c:" | cut -d: -f4- | sort | uniq -c
      2  Assignment of enum { CONFDB_OK, CONFDB_ERR_LIBRARY,
      1  Assignment of enum { CPG_OK, CPG_ERR_LIBRARY, CPG_ERR_TIMEOUT,
      1  Assignment of enum { EVS_OK, EVS_ERR_LIBRARY, EVS_ERR_TIMEOUT,
     30  Assignment of enum { SA_AIS_OK, SA_AIS_ERR_LIBRARY,
     48  Assignment of SaAisErrorT to confdb_error_t:
      7  Assignment of SaAisErrorT to confdb_error_t: error = res.error
     20  Assignment of SaAisErrorT to cpg_error_t:
     15  Assignment of SaAisErrorT to evs_error_t:
      7  Assignment of SaAisErrorT to quorum_error_t:
      2  Assignment of SaAisErrorT to quorum_error_t: error = res.error
     10  Assignment of ssize_t to int:
      1  Assignment of ssize_t to int: rb = read(fd, buf, len)
      1  Assignment of ssize_t to int: res = sendmsg(fd, &msg_send, 0)
      7  Buffer overflow possible with sprintf.  Recommend using
      1  Buffer overflow possible with sprintf.  Recommend using snprintf
      2  Corresponding format code
      2  Format argument 1 to printf (%s) expects char * gets
      2  Function assert expects arg 1 to be boolean gets int *:
      1  Function assert expects arg 1 to be boolean gets struct cmsghdr
      1  Function confdb_sa_reload redeclared with 3 args, previously
      1  Function confdb_sa_write redeclared with 2 args, previously
      1  Function _corosync_exit_error expects arg 1 to be enum
      5  Function main defined more than once
      2  Function main redeclared with 0 args, previously
      1  Function main redeclared with 2 args, previously
      1  Function parameter pool_sizes declared as manifest array
      1  Function parameter stats_avail declared as manifest array
      1  Function parameter stats_inuse declared as manifest array
      1  Function parameter stats_memoryused declared as manifest array
      1  Function poll expects arg 3 to be int gets unsigned long
      1  Initializer block for aisparser_iface_ver0 has 1 field, but
      1  Initializer block for apidef_corosync_api_v1 has 40 fields, but
      1  Initializer block for cfg_exec_engine[0] has 1 field, but struct
      1  Initializer block for cfg_exec_engine[2] has 1 field, but struct
      1  Initializer block for cfg_service_engine has 13 fields, but
      1  Initializer block for confdb_service_engine has 9 fields, but
      1  Initializer block for cpg_service_engine has 17 fields, but
      1  Initializer block for lcr_component_instance_database has 3
      1  Initializer block for lcr_iface_instance_database has 3
      1  Initializer block for poll_instance_database has 3 fields,
      1  Initializer block for sha1_desc has 9 fields, but struct
      3  *** Internal Bug at cscannerHelp.c:2428:
      1  *** Internal Bug at llerror.c:920:
      7  Operands of == have incompatible types (confdb_error_t, enum {
     38  Operands of != have incompatible types (confdb_error_t, enum {
     14  Operands of != have incompatible types (cpg_error_t, enum {
     10  Operands of != have incompatible types (evs_error_t, enum {
      1  Operands of == have incompatible types (quorum_dispatch_t,
      1  Operands of == have incompatible types (quorum_dispatch_t, enum
      3  Operands of != have incompatible types (quorum_dispatch_t, enum
      6  Operands of != have incompatible types (quorum_error_t, enum {
      1  Operands of == have incompatible types (SaAisErrorT, enum {
      1  Parameter 1, parent_object_handle, of function
      1  Parameter 2, flush, of function confdb_sa_reload has
      2  Parse Error. (For help on parse errors, see splint -help
      3  Previous declaration of main
      1  Previous definition of apidef_init
      5  Previous definition of main
      1  Previous definition of struct iface_list
      1  Previous definition of struct iface_ver1_list
      1  Previous definition of struct req_msg
      4  Previous definition of struct res_overlay
      1  Return value (type char *) ignored:
      4  Return value (type confdb_error_t) ignored:
      1  Return value (type confdb_error_t) ignored: do_find_destroy(...
     16  Return value type enum { SA_AIS_OK, SA_AIS_ERR_LIBRARY,
      7  Return value (type [function (int) returns void]) ignored:
      1  Return value (type __pid_t) ignored: setsid()
     26  Return value type SaAisErrorT does not match declared type
      8  Return value (type SaAisErrorT) ignored:
     12  Return value (type SaAisErrorT) ignored: saHandleDestroy(...
     89  Return value (type SaAisErrorT) ignored: saHandleInstance...
      1  Return value (type size_t) ignored: fwrite(output_bu...
      1  Return value (type size_t) ignored: strftime(char_ti...
      1  Return value (type ssize_t) ignored:
      1  Return value (type ssize_t) ignored: write(STDERR_FIL...
      1  Struct tag struct iface_list defined more than once
      1  Struct tag struct iface_ver1_list defined more than once
      1  Struct tag struct req_msg defined more than once
      4  Struct tag struct res_overlay defined more than once
      1  Unrecognized identifier: gettimeofday
      1  Unrecognized identifier: pthread_kill
      1  Unrecognized identifier: random
      2  Unrecognized identifier: SOL_SOCKET
      2  Unrecognized identifier: SO_PASSCRED
      1  Unrecognized identifier: strcasecmp
      4  Unrecognized identifier: strdup
      2  Unrecognized identifier: strtok_r
      1  Use vsnprintf instead: vsprintf
      3  Variable error initialized to type enum { SA_AIS_OK,
      1  Variable __x initialized to type unsigned long long, expects

Summary of warnings per file
-----------------------
cat lint.txt | grep -v ".c: (in function" |grep ".c:" | cut -d: -f1 | sort | uniq -c
      1    apidef.c
      2 apidef.c
      4    cfg.c
     22 cfg.c
    183 confdb.c
      3 coroparse.c
      2 coropoll.c
      7    corosync-cfgtool.c
      9 corosync-cfgtool.c
      3 corosync-fplay.c
      3 corosync-keygen.c
      2    corosync-objctl.c
      8 corosync-objctl.c
      2 corosync-pload.c
     67 cpg.c
      2 crypto.c
     47 evs.c
      8 ipc.c
      6 lcr_ifact.c
      2    libtest_a.c
      2 libtest_b.c
     10 logsys.c
      9 main.c
      1 mainconfig.c
      4 mempool.c
      8 pload.c
     46 quorum.c
      4 sa-confdb.c
      4 sync.c
      1    test.c
      1    uic.c
      2 uic.c
      3 uis.c
      3 /usr/include/bits/confname.h
      6 util.c




More information about the Openais mailing list