Questions tagged [compiler-flags]

Parameters that may be passed to a compiler affecting how compilation is carried out. These can have a variety of effects on the paths searched for external dependencies, optimization level, how source code is interpreted, code checks that are performed and preprocessor directives.

Parameters that may be passed to a compiler affecting how compilation is carried out. These can have a variety of effects on the paths searched for external dependencies, optimization level, how source code is interpreted, code checks that are performed and preprocessor directives.

479 questions
0
votes
2 answers

GDB break line in Bomb Project

I have a CS project that I need to diffuse a bomb (the Mr.Evil bomb if you have ever heard about it), but I am having problems with gdb when I want to set break points to lines. After I open the file in gdb and try to break a t a random line I get…
FranXh
  • 4,481
  • 20
  • 59
  • 78
0
votes
1 answer

Cmake errors of installing ccons

After I execute cmake CMakeLists.txt, which seems to give no errors, I run make which gives me the following error: :/usr/local/src/llvm-3.1.src/tools/ccons$ sudo make [ 7%] Building CXX object…
mko
  • 21,334
  • 49
  • 130
  • 191
0
votes
1 answer

What do the include paths/numbers in preprocessed output of icpc (or gcc I guess) mean?

If I use the -E flag when compiling, I get the pre-processed output. Some of the lines in this output is :- # 4 "../Framework.h" 2 # 1 "../Basic.h" 1 # 1 "/usr/include/c++/4.1.2/queue" 1 3 What does it mean? Is there a source that you can point…
owagh
  • 3,428
  • 2
  • 31
  • 53
-1
votes
1 answer

using -march switch for gcc does not make a difference in terms of run-time speed

I built a small program (~1000 LOC) using GCC 11.1 and ran it for many iterations both with and without enabling -march=native but overall there was no difference in terms of program execution time (measured in milliseconds). But why? Because it's…
digito_evo
  • 3,216
  • 2
  • 14
  • 42
-1
votes
2 answers

Few basic GCC flag questions

I'm trying to complie and run my C program. The program uses threads. I'm running windows 10 using WSL with Ubuntu terminal. (Also trying it with Ubuntu virtual box) This is my "default" Makefile format im using for all my programs (changing name…
Gal Birka
  • 581
  • 6
  • 16
-1
votes
3 answers

Illegal Instruction with mm_cmpeq_epi8_mask

Im trying to run code similar to the following #include void foo() { __m128i a = _mm_set_epi8 (0,0,6,5,4,3,2,1,8,7,6,5,4,3,2,1); __m128i b = _mm_set_epi8 (0,0,0,0,0,0,0,1,8,7,6,5,4,3,2,1); __mmask16 m =…
-1
votes
2 answers

gcc won't let me 'just compile' c source after addition of source files

I'm writing a program that looks roughly like this: Some main code in src/ Some code in Demo1/ I compile Demo1's stuff into .o , then .so, and use that .so in the creation of the main executable. (Demo1's code is used in src/). Demo1 uses an…
-1
votes
2 answers

C++ Macro causing :"warning: unused variable "LOG__METHOD__" "

I have a macro in my C++ code, macro has an unused variable. I am getting warning for that variable the macro is to print the class and method name #define LOG_ENTER(func_name, message) \ …
rkk
  • 51
  • 1
  • 4
-2
votes
1 answer

Add compile flags per default clang++

I want to add some flags per default, so as not to type them at each compilation. is there any way to add compile flags per default ? Like optimisation flags or whatever. I found a solution with alias, but i dont know if its a good way, if u have…
user18129922
-2
votes
2 answers

Add a flag to a C program

I wrote a C program that will need to run with seemingly custom flags. I have an executable named "hw3" that I would use ./hw3 in Terminal to run. Now I want my program to take parameters in if you run it using the flags ./hw3 -check ./hw3…
kostaszx
  • 1
  • 1
  • 3
-3
votes
1 answer

Nvcc Optimization Flags

I have a CUDA c++ code.I'm doing some operations with OpenCV in this code.I compile program nvcc file.cu -o o2 `pkg-config --libs --cflags opencv4 command.I wonder that which nvcc optimization flags would be the best ,efficient and useful ?…
-3
votes
1 answer

GCC Wunused-variable warns for used variable

I am using GCC version 8.2 On several pieces of code, I use small functions. On each one of the functions, I have tests (i.e. Unity framework tests). The tests are defined as #define macros, testing very specific things. For instance, if a number if…
Felipe GM
  • 129
  • 1
  • 8
-5
votes
2 answers

Optimization setting

In c we can enble the optimization setting by enabling the flag -O for enable all the possible optimization and -O0 will disable all enabled optimization. My question is that this flags are message to whom?means to compiler or kernel?
-7
votes
1 answer

C++ program flags

I write a program in C++, and the complier is G++ Now in the terminal, if I type ./main and enter it will run. Yet I want to add something like a flag: ./main -apple or ./main -orange apple and orange are two different methods to calculate one same…
Euler
  • 335
  • 2
  • 5
  • 14
1 2 3
31
32