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

📄 string-opt-16.c

📁 gcc-you can use this code to learn something about gcc, and inquire further into linux,
💻 C
字号:
/* Copyright (C) 2001  Free Software Foundation.   Ensure that builtin memcmp operations when all three arguments   are constant is optimized and performs correctly.  Taken from   PR optimize/3508.   Written by Roger Sayle, 12/26/2001.  */extern void abort (void);extern void link_error (void);typedef __SIZE_TYPE__ size_t;extern int memcmp (const void *, const void *, size_t);intmain (int argc){  if (memcmp ("abcd", "efgh", 4) >= 0)     link_error ();  if (memcmp ("abcd", "abcd", 4) != 0)     link_error ();  if (memcmp ("efgh", "abcd", 4) <= 0)     link_error ();  return 0;}#ifdef __OPTIMIZE__/* When optimizing, all the above cases should be transformed into   something else.  So any remaining calls to the original function   should abort.  */static intmemcmp (const void *s1, const void *s2, size_t len){  abort ();}#else/* When not optimizing, the above tests may generate references to   the function link_error, but should never actually call it.  */static voidlink_error (){  abort ();}#endif

⌨️ 快捷键说明

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