When should I use GCC’s -pipe option?

In our experience with a medium-sized project, adding -pipe made no discernible difference in build times. We ran into a couple of problems with it (sometimes failing to delete intermediate files if an error was encountered, IIRC), and so since it wasn’t gaining us anything, we quit using it rather than trying to troubleshoot those … Read more

How can I hide “defined but not used” warnings in GCC?

Just saw this thread while searching for solutions to this problem. I post here for completeness the solution I found… The GCC compiler flags that control unused warnings include: -Wunused-function -Wunused-label -Wunused-parameter -Wunused-value -Wunused-variable -Wunused (=all of the above) Each of these has a corresponding negative form with “no-” inserted after the W which turns … Read more

Is it possible to use GPU acceleration on compiling multiple programs on a gcc compiler?

A. In an imperative programming language, statements are executed in sequence, and each statement may change the program’s state. So analyzing translation units is inherently sequential. An example: Check out how constant propagation might work – a = 5; b = a + 7; c = a + b + 9; You need to go … Read more

How to specify non-default shared-library path in GCC Linux? Getting “error while loading shared libraries” when running

There are two ways to achieve that: Use -rpath linker option: gcc XXX.c -o xxx.out -L$HOME/.usr/lib -lXX -Wl,-rpath=/home/user/.usr/lib Use LD_LIBRARY_PATH environment variable – put this line in your ~/.bashrc file: export LD_LIBRARY_PATH=/home/user/.usr/lib This will work even for a pre-generated binaries, so you can for example download some packages from the debian.org, unpack the binaries and … Read more

ARM compilation error, VFP registers used by executable, not object file

Your target triplet indicates that your compiler is configured for the hard-float ABI. This means that the libgcc library will also be hardfp. The error message indicates that at least part of your system is using soft-float ABI. If the compiler has multilib enabled (you can tell with -print-multi-lib) then you can use -mfloat-abi=softfp, but … Read more

Selectively remove a warning message using GCC

If you need that code to work portable then you should cast the argument to unsigned int, as the int type may have a different size than Int32 on some platforms. To answer your question about disabling specific warnings in GCC, you can enable specific warnings in GCC with -Wxxxx and disable them with -Wno-xxxx. … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)