News for hackers. Stuff that matters.
Re:Compiler Explorer by kazinator on Friday December 14, 2018 @02:31PM (#18683814)
Or, in one line of shell:

  echo 'int square(int num) { return num*num; }' | gcc -S -x c - -o -
How about this: open an editor on "test.c". Then in another terminal window, run this script:

  #!/bin/sh

  rm -f test_copy.c

  while true ; do
    if [ test.c -nt test_copy.c ] ; then
      cp test.c test_copy.c
      clear
      gcc -S test_copy.c -o -
    fi
    sleep 0.3
  done
Every time you save test.c, the compiler output updates in the other shell window (within a fraction of a second).
Re:Compiler Explorer by steveklabnik on Friday December 14, 2018 @03:17PM (#18684292)
Godbolt has many more features than this. It can show you mappings from your code to the outputted asm, it can show help text on what instructions mean, you can compare multiple compilers against the same source file easily...