You can use
#pragma GCC push_options
#pragma GCC optimize ("O0")
your code
#pragma GCC pop_options
to disable optimizations since GCC 4.4.
See the GCC documentation if you need more details.
More Related Contents:
- Removing trailing newline character from fgets() input
- Modulo operation with negative numbers
- C undefined behavior. Strict aliasing rule, or incorrect alignment? [duplicate]
- Order of local variable allocation on the stack
- What is the meaning of lines starting with a hash sign and number like ‘# 1 “a.c”‘ in the gcc preprocessor output?
- Why does GCC create a shared object instead of an executable binary according to file?
- Linking two shared libraries with some of the same symbols
- How do I make a simple makefile for gcc on Linux?
- String literals vs array of char when initializing a pointer
- How to include needed C library using gcc?
- Finding out what the GCC include path is [duplicate]
- GCC fatal error: stdio.h: No such file or directory
- Why doesn’t GCC optimize structs?
- Creating static Mac OS X C build
- How can I multiply 64 bit operands and get 128 bit result portably?
- Why do I have to define LD_LIBRARY_PATH with an export every time I run my application?
- Is there a macro definition to check the Linux kernel version?
- Why does gcc allow arguments to be passed to a function defined to be with no arguments?
- Status of __STDC_IEC_559__ with modern C compilers
- Errors using ternary operator in c
- What is the default C -std standard version for the current GCC (especially on Ubuntu)?
- Check glibc version for a particular gcc compiler
- What is “…” in switch-case in C code
- How to link to a different libc file?
- C code with undefined results, compiler generates invalid code (with -O3)
- Compiler changes printf to puts
- Returning struct containing array
- Compiling a C program that uses OpenGl in Mac OS X
- Why does malloc allocate a different number of bytes than requested?
- & operator optional in function pointer assignment