gen_isr_tables: Function ptr instead of (void *)

gen_isr_tables.py generates C-code which initializes a table with
values, and these values are structs with members cast to
(const void *) and (void *), respectively.

The actual struct definition has a member of type (const void *)
and another of type void (*)(const void *).

In order to avoid a large amount of reported issues in Coverity,
cast this to the exact type.

Signed-off-by: Torstein Grindvik <torstein.grindvik@nordicsemi.no>
This commit is contained in:
Torstein Grindvik 2020-09-30 10:36:26 +02:00 committed by Ioannis Glaropoulos
parent 780fa73b83
commit c02eb30bbf

View file

@ -139,6 +139,7 @@ source_header = """
#define ISR_WRAPPER NULL
#endif
typedef void (* ISR)(const void *);
"""
def write_source_file(fp, vt, swt, intlist, syms):
@ -175,7 +176,7 @@ def write_source_file(fp, vt, swt, intlist, syms):
fp.write("\t/* Level 3 interrupts start here (offset: {}) */\n".
format(level3_offset))
fp.write("\t{{(const void *){0:#x}, (void *){1}}},\n".format(param, func_as_string))
fp.write("\t{{(const void *){0:#x}, (ISR){1}}},\n".format(param, func_as_string))
fp.write("};\n")
def get_symbols(obj):