Hi.
I don't seem to be able to get out of this problem.
In my file queue.h I have declared:
#include <pthread.h> #define Q_HDR_INT_SZ 4 #define Q_HDR_SZ (sizeof(pthread_mutex_t) + Q_HDR_INT_SZ)
When using the macro, I get:
Variable 'pthread_mutex_t' is unknown
Anyone can guide me to why this error is being generated and to fix it?
Is the output really generated by cppcheck? I can't reproduce this with the code above.
Sorry CHR. I realised was say too brief in the description. Here is a more detailed output:
cppcheck version: 2.13.0
$ cppcheck --addon=test/pipeline/coding_stds/misra.json --error-exitcode=255 -I/home/user/devel/repos/project/common/src/utils /home/user/devel/common/src/comp/comp_queue.c
And the result:
. . . Checking project/common/src/comp/comp_queue.c: SYSCFG_COMP_USE... project/common/src/comp/comp_queue.c:284:10: error: Variable 'pthread_mutex_t' is unknown [misra-config] if ((Q_HDR_SZ+(Q_ELEM_HDR_SZ+pkt_sz)*inbuf_cap) != inbuf_sz) ^ project/common/src/comp/comp_queue.c:291:10: error: Variable 'pthread_mutex_t' is unknown [misra-config] if ((Q_HDR_SZ+(Q_ELEM_HDR_SZ+pkt_sz)*outbuf_cap) != outbuf_sz) ^ . . .
And queue.h is in the /home/user/devel/repos/project/common/src/utils directory
/home/user/devel/repos/project/common/src/utils
Log in to post a comment.
Hi.
I don't seem to be able to get out of this problem.
In my file queue.h I have declared:
When using the macro, I get:
Anyone can guide me to why this error is being generated and to fix it?
Is the output really generated by cppcheck? I can't reproduce this with the code above.
Sorry CHR. I realised was say too brief in the description. Here is a more detailed output:
cppcheck version: 2.13.0
$ cppcheck --addon=test/pipeline/coding_stds/misra.json --error-exitcode=255 -I/home/user/devel/repos/project/common/src/utils /home/user/devel/common/src/comp/comp_queue.c
And the result:
And queue.h is in the
/home/user/devel/repos/project/common/src/utils
directory