LoginSignup
0
1

More than 5 years have passed since last update.

c++ builder XE4, 10.2 Tokyo > 0b0001でコンパイルエラー > E2293) が必要

Last updated at Posted at 2016-04-17
動作確認
C++ Builder XE4
Rad Studio 10.2 Tokyo Update 2 (追記: 2017/12/27)

ideoneで動作するコード
http://ideone.com/r0lfwl

#include <stdio.h>
#include <stdint.h>

#define ALERT1_CHECK (0b0001)
#define ALERT2_CHECK (0b0010)
#define ALERT3_CHECK (0b0100)
#define ALERT4_CHECK (0b1000)

int main(void) {
    uint8_t ret = 0;

    ret |= ALERT1_CHECK;
    ret |= ALERT2_CHECK;
    ret |= ALERT3_CHECK;
    ret |= ALERT4_CHECK;

    printf("%x\n", ret);
    return 0;
}

これをXE4で実装しようとすると
ret |= ALERT1_CHECK;の4行で

E2293)が必要

となる。

#define ALERT1_CHECK (0b0001)

#define ALERT1_CHECK (0x1)
のように2進表記から16進表記にすると上記のエラーは発生しない。

2進表記の扱いが特殊なのだろうか?

時間がないので調査は保留。



(追記 2016/08/17)

E2141 Declaration syntax error
というエラーも出た。

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1