MSVC2013RC は、以前のバージョンの MSVC よりも c 標準をより適切に処理すると聞いたので、MSVC2013RC をダウンロードしました。だから私はそれをダウンロードして、Windowsプラットフォームで本当に探していたものをいくつかテストしました.
しかし、すでに最初のテストでかなりがっかりしました。
#include <stdlib.h>
#include <stdbool.h>
#include <stdio.h>
int testFunction(int iIn);
int main(int argc, char** argv)
{
int *TheKiddingBool;
TheKiddingBool= NULL;
TheKiddingBool= malloc(sizeof (int));
*TheKiddingBool= 17;
_Bool bWow;
bWow = true;
if (testFunction(*TheKiddingBool) == bWow)
{
printf("\r\nQAtest succesed!\r\n");
}
return 0;
}
int testFunction(int iIn)
{
return iIn;
}
の比較testFunction(*TheKiddingBool) == bWow
は false を返します。これは、MSVC13 の C コンパイラのかなり難しいバグですか?
それとも私はその線を理解しているだけですか
6.3.1.2 ブール型
§1 スカラー値が _Bool に変換されるとき、値が 0 と等しい場合、結果は 0 です。それ以外の場合、結果は 1 です。
c99 ISO/IEC 9899:TC3 はかなり間違っていますか?