builtin-protos-1.c

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

C
69
字号
/* { dg-do compile } *//* { dg-options -Wtraditional-conversion } */inttest_s (signed int x){  return __builtin_abs (x)	/* { dg-bogus "as unsigned due to prototype" } */    + __builtin_clz (x)		/* { dg-warning "as unsigned due to prototype" } */    + __builtin_ctz (x)		/* { dg-warning "as unsigned due to prototype" } */    + __builtin_ffs (x)		/* { dg-bogus "as unsigned due to prototype" } */    + __builtin_parity (x)	/* { dg-warning "as unsigned due to prototype" } */    + __builtin_popcount (x);	/* { dg-warning "as unsigned due to prototype" } */}inttest_u (unsigned int x){  return __builtin_abs (x)	/* { dg-warning "as signed due to prototype" } */    + __builtin_clz (x)		/* { dg-bogus "as signed due to prototype" } */    + __builtin_ctz (x)		/* { dg-bogus "as signed due to prototype" } */    + __builtin_ffs (x)		/* { dg-warning "as signed due to prototype" } */    + __builtin_parity (x)	/* { dg-bogus "as signed due to prototype" } */    + __builtin_popcount (x);	/* { dg-bogus "as signed due to prototype" } */}inttest_sl (signed long x){  return __builtin_labs (x)	/* { dg-bogus "as unsigned due to prototype" } */    + __builtin_clzl (x)	/* { dg-warning "as unsigned due to prototype" } */    + __builtin_ctzl (x)	/* { dg-warning "as unsigned due to prototype" } */    + __builtin_ffsl (x)	/* { dg-bogus "as unsigned due to prototype" } */    + __builtin_parityl (x)	/* { dg-warning "as unsigned due to prototype" } */    + __builtin_popcountl (x);	/* { dg-warning "as unsigned due to prototype" } */}inttest_ul (unsigned long x){  return __builtin_labs (x)	/* { dg-warning "as signed due to prototype" } */    + __builtin_clzl (x)	/* { dg-bogus "as signed due to prototype" } */    + __builtin_ctzl (x)	/* { dg-bogus "as signed due to prototype" } */    + __builtin_ffsl (x)	/* { dg-warning "as signed due to prototype" } */    + __builtin_parityl (x)	/* { dg-bogus "as signed due to prototype" } */    + __builtin_popcountl (x);	/* { dg-bogus "as signed due to prototype" } */}inttest_sll (signed long long x){  return __builtin_llabs (x)	/* { dg-bogus "as unsigned due to prototype" } */    + __builtin_clzll (x)	/* { dg-warning "as unsigned due to prototype" } */    + __builtin_ctzll (x)	/* { dg-warning "as unsigned due to prototype" } */    + __builtin_ffsll (x)	/* { dg-bogus "as unsigned due to prototype" } */    + __builtin_parityll (x)	/* { dg-warning "as unsigned due to prototype" } */    + __builtin_popcountll (x);	/* { dg-warning "as unsigned due to prototype" } */}inttest_ull (unsigned long long x){  return __builtin_llabs (x)	/* { dg-warning "as signed due to prototype" } */    + __builtin_clzll (x)	/* { dg-bogus "as signed due to prototype" } */    + __builtin_ctzll (x)	/* { dg-bogus "as signed due to prototype" } */    + __builtin_ffsll (x)	/* { dg-warning "as signed due to prototype" } */    + __builtin_parityll (x)	/* { dg-bogus "as signed due to prototype" } */    + __builtin_popcountll (x);	/* { dg-bogus "as signed due to prototype" } */}

⌨️ 快捷键说明

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