Quiet down compilation of f2c'ed code

The generated code has a whole lot of warnings with the roborio
compiler. This at least cuts down on the obviously boring ones.

Change-Id: I18ab2795229158c90d6e0b7b0970a566fbcae323
diff --git a/debian/clapack.BUILD b/debian/clapack.BUILD
index 9648bab..8d805c3 100644
--- a/debian/clapack.BUILD
+++ b/debian/clapack.BUILD
@@ -1,6 +1,7 @@
 licenses(["notice"])
 
 load("@//tools/build_rules:fortran.bzl", "f2c_copts")
+load("@//tools/build_rules:select.bzl", "compiler_select")
 
 genrule(
     name = "create_sysdep1",
@@ -280,7 +281,6 @@
         "-Wno-sign-compare",
         "-Wno-cast-qual",
         "-Wno-cast-align",
-        "-Wno-self-assign",
 
         # Some files don't #include system headers when they should. sysdep1.h
         # messes with feature test macros, so it always has to come first.
@@ -292,7 +292,14 @@
         # Don't mangle the names of all the BLAS symbols, because slicot needs to
         # call them directly.
         "-DNO_BLAS_WRAP",
-    ],
+    ] + compiler_select({
+        "clang": [
+            "-Wno-self-assign",
+        ],
+        "gcc": [
+            "-Wno-discarded-qualifiers",
+        ],
+    }),
     includes = [
         "F2CLIBS/libf2c",
         "INCLUDE",
diff --git a/debian/slycot.BUILD b/debian/slycot.BUILD
index 368b87d..7463173 100644
--- a/debian/slycot.BUILD
+++ b/debian/slycot.BUILD
@@ -2,6 +2,7 @@
 licenses(["restricted"])
 
 load("@//tools/build_rules:fortran.bzl", "f2c_library")
+load("@//tools/build_rules:select.bzl", "compiler_select")
 
 # We can't create _wrapper.so in the slycot folder, and can't move it.
 # The best way I found to do this is to modify _wrapper.pyf to instead generate
@@ -135,7 +136,13 @@
         # This gets triggered because it doesn't realize xerbla doesn't return.
         # TODO(Brian): Try and get __attribute__((noreturn)) on xerbla somehow.
         "-Wno-uninitialized",
-    ],
+    ] + compiler_select({
+        "clang": [
+        ],
+        "gcc": [
+            "-Wno-discarded-qualifiers",
+        ],
+    }),
     visibility = ["//visibility:public"],
     deps = [
         "@clapack",