Project

General

Profile

Actions

Bug #3148

closed

scan-build warnings for ac implementations

Added by Victor Julien about 5 years ago. Updated over 1 year ago.

Status:
Closed
Priority:
Normal
Assignee:
Target version:
Affected Versions:
Effort:
Difficulty:
Label:

Description

  CC       util-mpm-ac-bs.o
util-mpm-ac-bs.c:487:32: warning: Result of 'malloc' is converted to a pointer of type 'uint16_t [256]', which is incompatible with sizeof operand type 'uint16_t'
        ctx->state_table_u16 = SCMalloc(ctx->state_count *
                               ^~~~~~~~
./util-mem.h:37:18: note: expanded from macro 'SCMalloc'
#define SCMalloc malloc
                 ^~~~~~
util-mpm-ac-bs.c:528:32: warning: Result of 'malloc' is converted to a pointer of type 'uint32_t [256]', which is incompatible with sizeof operand type 'uint32_t'
        ctx->state_table_u32 = SCMalloc(ctx->state_count *
                               ^~~~~~~~
./util-mem.h:37:18: note: expanded from macro 'SCMalloc'
#define SCMalloc malloc
                 ^~~~~~
2 warnings generated.
  CC       util-mpm-ac.o
util-mpm-ac.c:571:32: warning: Result of 'malloc' is converted to a pointer of type 'uint16_t [256]', which is incompatible with sizeof operand type 'uint16_t'
        ctx->state_table_u16 = SCMalloc(ctx->state_count *
                               ^~~~~~~~
./util-mem.h:37:18: note: expanded from macro 'SCMalloc'
#define SCMalloc malloc
                 ^~~~~~
util-mpm-ac.c:614:32: warning: Result of 'malloc' is converted to a pointer of type 'uint32_t [256]', which is incompatible with sizeof operand type 'uint32_t'
        ctx->state_table_u32 = SCMalloc(ctx->state_count *
                               ^~~~~~~~
./util-mem.h:37:18: note: expanded from macro 'SCMalloc'
#define SCMalloc malloc
                 ^~~~~~
2 warnings generated.

Subtasks 1 (0 open1 closed)

Bug #6017: scan-build warnings for ac implementations (6.0.x backport)ClosedVictor JulienActions

Related issues 1 (1 open0 closed)

Related to Suricata - Task #3153: tracking: scan-build warningsIn ProgressVictor JulienActions
Actions

Also available in: Atom PDF