⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cast-qual-1.c

📁 this is a gcc file, you can download it and learn its usetility, for further detail please look at t
💻 C
字号:
/* Incorrect `cast discards `const'' warnings.  There should be warnings   in bad_cast and bad_assign; bad_assign gets the correct warning, but   good_cast may get the warning instead of bad_cast.   gcc 2.7.2.3 passes, egcs-1.1.2 and egcs-ss-19990428 fail.   http://gcc.gnu.org/ml/gcc-bugs/1998-08/msg00645.html *//* { dg-do compile } *//* { dg-options "-Wcast-qual" } */voidgood_cast(const void *bar){  (char *const *)bar; /* { dg-bogus "cast discards" "discarding `const' warning" } */}voidbad_cast(const void *bar){  (const char **)bar; /* { dg-warning "cast discards" "discarding `const' warning" } */}voidgood_assign(const void *bar){  char *const *foo = bar; /* { dg-bogus "initialization discards" "discarding `const' warning" } */}voidbad_assign(const void *bar){  const char **foo = bar; /* { dg-warning "initialization discards" "discarding `const' warning" } */}

⌨️ 快捷键说明

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