MISRA Discussion Forums

Full Version: Mixed C/C++ build environment
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Could you write an explicit chapter on how to deal with this situation in the next version of the standard?
For example, i don't think this is what MISRA intended: http://support.gimpel.com/forums/225702-...th-mixed-c
Also, consider adding exceptions to some rules in the context of headers being included in both C and C++ modules:

#ifndef FOO_H
#define FOO_H

#define MAGIC_CONSTANT 123456/*Violates MISRA C++ Rule 16-2-2, but is fine in C and changing would require storage in C (effiency)*/
typedef int int32_t;

#ifdef __cplusplus
extern "C"

int32_t foo_api(void);

#ifdef __cplusplus


Thank you very much.