c - Pc-lint doesnt understand types from a included header file -
i'm trying use pc-lint on large c project uses 3rd party compiler (tasking tricore v4.1r2). lint reports loads of errors of them seem lint not working properly, due configuration. im wondering if can see cause (or knows how prevent) following errors:
i've got header file typedefs this:
#ifndef foo_types_h #define foo_types_h typedef unsigned char u8; typedef unsigned long u32; #endif
in lint output, can see file being processed, , seems pass no errors. next file being processed includes above 1 as:
#include "foo_types.h"
in second file ive got struct defined this:
typedef struct { u8 v1; u32 v2; } foo_struct;
but lint gives me errors these:
warning line 71: no explicit type symbol 'foo_struct::u32', int assumed. lint code: 601 error line 71: expecting ';'. lint code: 10
this indicate me didnt recognise included file "foo_types.h", , causes loads of problems further down line. .c file im linting looks this:
#include <stdlib.h> #include "foo.h" #include "foo_types.h" void bar(u8 v1, u32 v2) { foo_struct s; s.v1 = v1; s.v2 = v2; }
ive specified of include folders in std.lnt , being processed. when run lint -p option, can see go through whole list of includes before starts processing .c module.
also file names unique shouldn't cause issues.
edit: file: stdlib.h
typedef unsigned int size_t; //some more definitions doesnt complain here .. //next line causes lint complain extern void * calloc(size_t,size_t)__malloc__;
this lint says:
note line 70: function 'calloc' defined without prototype in scope. lint code: 957 error line 70: expecting ';'. lint code: 10
there no previous mention of calloc or malloc in file , doesnt include else. there way make lint see in not error?
edit2: these options im using, problem lies:
//most of stuff got colleague -dkb_scheduler=1;bit_bashed_dallas=1;ibc_dev_cid_ctrl=1;sw_clock_tick_period_ms=8;rtc_hw_fitted=1;__ctc__=1;osc_freq_mhz=20;tx_delay_active;ctrl_cpu=1;cpu_freq_mhz=300;zeroed_crc=1;tc1798_cpu;bcu_build=1;new_com_can_link=1;__model__=1;__nop=_nop_;__align()=; // handle of non standard compiler keywords tasking //compiler on tri-core. -d__attribute__()= +rw(_bit) -dsbit=_bit -e537 -e534 -pragma(message) // not issue pragma messages -esym(950, sdata,bdata,idata,huge,xhuge,far,near) // don't stop make because of warnings -zero(99) //suppress ansi/iso limit of 6 'significant characters in external //identifier', 'trace_buffer', exceeded -- processing unaffected info -e793 -esym(960, 17.4) // misra rule 17.4 - pointer arithmetic other array //indexing used not seem work on pc lint. -emacro(960,true) -emacro(961,true) -emacro(506,true) -emacro(960,false) -emacro(961,false) -emacro(506,false) -emacro(960,assert_release) -emacro(961,assert_release) -esym(718,__mfcr) -esym(746,__mfcr) -esym(960,__mfcr) -esym(718,__mtcr) -esym(746,__mtcr) -esym(960,__mtcr) -d__interrupt(x)= -d__trap(x)= -dinline= -d__noinline= -md -si2 -spn2 -spf4 +libclass( angle )
any tips on how approach fixing problem appreciated, eg. check first, change first etc
thank you.
Comments
Post a Comment