selectany2.c

来自「用于进行gcc测试」· C语言 代码 · 共 31 行

C
31
字号
// { dg-do compile { target i?86-pc-cygwin } }// { dg-do compile { target i?86-pc-mingw* } }// Check for errors with invalid usage of selectany attribute.extern int foo;__declspec (selectany) int foo = 1;  // OKstruct d{  static int foo;};__declspec (selectany) int d::foo = 1;  // OK struct  f{  int i;};__declspec (selectany) struct f  F= {1}; // OK__declspec (selectany) int boo;	//{ dg-error "selectany" }__declspec (selectany) static int bar = 1; // { dg-error "selectany" }int use_bar = bar;  //  Avoid defined but not used warning. int baz(){  __declspec (selectany)  int foo = 1;  // { dg-error "selectany" }  return foo;}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?