(v) is actually (*&v) since when?

前端 未结 3 1908
臣服心动
臣服心动 2021-02-13 00:32

Could C++ standards gurus please enlighten me:

Since which C++ standard version has this statement failed because (v) seems to be equivalent to (*&

3条回答
  •  我在风中等你
    2021-02-13 01:02

    Your worry is unwarranted since the file in question does not actually contain the register keyword:

    grep "register" /usr/include/linux/rtnetlink.h
    

    outputs nothing. Either way, you shouldn't be receiving the warning since:

    • System headers don't emit warnings by default, at least in GCC

    • It isn't wise to try to compile a file that belongs to a systems project like the linux kernel in C++ mode, as there may be subtle and nasty breaking changes

    Just include the file normally or link the C code to your C++ binary. Report a bug if you really are getting a warning that should normally be suppressed to your compiler vendor.

提交回复
热议问题