Type punning a struct in C and C++ via a union

后端 未结 4 911
一生所求
一生所求 2020-12-17 19:29

I\'ve compiled this in gcc and g++ with pedantic and I don\'t get a warning in either one:

#include 
#include 
#include 

        
4条回答
  •  遥遥无期
    2020-12-17 19:42

    Yes, this is fine; the bolded part of the quote in your question covers this case.

提交回复
热议问题