Disable assembler warning ".section __TEXT,__textcoal_nt,coalesced,pure_instructions"

At present, you cannot disable those warnings. You should probably file a bug report against FSF GCC to have them update their codegen to be more compliant.

You might also want to file a bug report with llvm.org to request that there be a way to silence these warnings or limit the number that are issued so as to not deluge the user.


Apparently there's no way to disable those warnings, but I like your idea of just filtering them out of the build output.

I find sed to be too tricky to bother with for complicated (e.g. multi-line) match/replace patterns. Here's a simple Python program to filter such warning noise from stderr, without hiding stderr entirely.

#!/usr/bin/python
# 
# filter-noisy-assembler-warnings.py
# Author: Stuart Berg

import sys

for line in sys.stdin:
    # If line is a 'noisy' warning, don't print it or the following two lines.
    if ('warning: section' in line and 'is deprecated' in line
    or 'note: change section name to' in line):
        next(sys.stdin)
        next(sys.stdin)
    else:
        sys.stderr.write(line)
        sys.stderr.flush()

A convenient way to use that program is via bash process substitution, applied only to stderr:

$ make 2> >(python filter-noisy-assembler-warnings.py)

Or with your build command, this ought to do the trick, I think:

$ CXXFLAGS="-DNDEBUG -g2 -O2" make CXX=/opt/local/bin/g++-mp-6 2> >(python filter-noisy-assembler-warnings.py)

That way, stdout isn't redirected at all, and most of stderr is written out verbatim, except for those particular annoying warnings.