-1

Run the following command in linux bash:

# echo 'main() { __asm__("xorb %al, %al"); }' | gcc -x c -

Q1: What's the meaning of the last - ?

Q2: Whether the - is a parameter of gcc or shell ?

Another -- when use cmake

# cmake --build ./build-cmake/Debug/obj --target processor_benchmark -- -j4

Q3: What's the meaning of -- before -j4 ?

loverszhaokai
  • 127
  • 10

1 Answers1

4

Is it possible to get gcc to read from a pipe?

The - tells gcc to read from stdin ie. the pipe.

https://cmake.org/cmake/help/v3.2/manual/cmake.1.html

Pass remaining options to the native tool.

-- will send -j4 to make. make -j4 or -j8

Community
  • 1
  • 1
Powersource
  • 120
  • 1
  • 13