나는 매우 새로운 sparse
입니다. 코드에서 노이즈를 제거하는 데 사용하고 있습니다. sparse
이 경고를보고 왜왜 sparse가 sizeof (bool) 경고를보고합니까?
warning: expression using sizeof bool
궁금 : 최근 어딘가에 코드 라인 : kzalloc(sizeof(bool) * nvhost_syncpt_nb_pts(sp), GFP_KERNEL);
나는이 sparse
경고가 발생했습니다. 인터넷 검색에서 sizeof (bool)가 컴파일러에 종속적이라는 사실을 발견했습니다. 이는 매우 분명합니다. 이 경고가 왜보고되어서는 안되는 sparse
에 의해 제기되었는지 왜 저를 도와주십시오? 내가 틀렸다면 나를 바로 잡아주세요.
나는 gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5)
을 사용하고 있습니다.
#if !defined(__cplusplus)
# if defined(_MSC_VER) || !defined(__STDC_VERSION__) || \
(__STDC_VERSION__ < 199901L)
// The Visual Studio C compiler and older versions of GCC do not support C99
// and thus have no bool or stdbool.h. Make a simple definition of bool,
// true, and false to make this deprecated interface compile in C. Force it
// to 1 byte to have some chance of ABI compatibility between C and C++, in
// case we don't remove this.
typedef char bool;
# define false 0
# define true 1
# else
// In C99-compliant compilers, we can include stdbool.h to get a bool
// definition.
# include <stdbool.h>
# endif
#endif
/**
* @}
* End addtogroup PP
*/
#endif /* PPAPI_C_DEV_DEPRECATED_BOOL_H_ */