Update WPILib, roborio compilers, and CTRE Phoenix libraries

This borrows heavily from work that Ravago did to initially get this
stuff working.

Tested rudimentary functionality on a test bench, ensured that we could:
* Enable the robot.
* Read joystick and button values.
* Switch between auto and teleop modes.
* Read sensor values (encoder, absolute encoder, potentiometer).
* Read PDP values.
* Drive PWM motors.
* Drive CANivore motors.

Non-WPILib changes are made to accommodate the upgrade roborio
compiler's improved pickiness.

Merge commit '125aac16d9bf03c833ffa18de2f113a33758a4b8' into HEAD

Change-Id: I8648956fb7517b2d784bf58e0a236742af7a306a
Signed-off-by: James Kuszmaul <jabukuszmaul+collab@gmail.com>
diff --git a/third_party/gperftools/BUILD b/third_party/gperftools/BUILD
index 14ac821..3eaab4b 100644
--- a/third_party/gperftools/BUILD
+++ b/third_party/gperftools/BUILD
@@ -32,8 +32,9 @@
     "-Wno-switch-enum",
     "-Wno-error=cast-align",
     "-Wno-error=cast-qual",
-    "-Wno-deprecated-volatile",
     "-Wno-cast-qual",
+    "-Wno-array-bounds",
+    "-Wno-cast-function-type",
 
     # //build_tests:tcmalloc_build_test relies on this.
     "-DENABLE_LARGE_ALLOC_REPORT=1",
@@ -128,7 +129,10 @@
         # disable the analysis to simplify.
         "-Wno-thread-safety-analysis",
     ],
-    "gcc": [],
+    "gcc": [
+        "-Wno-use-after-free",
+        "-Wno-ignored-qualifiers",
+    ],
 })
 
 cc_library(
diff --git a/third_party/gperftools/src/base/linuxthreads.cc b/third_party/gperftools/src/base/linuxthreads.cc
index 1e7f137..1504730 100644
--- a/third_party/gperftools/src/base/linuxthreads.cc
+++ b/third_party/gperftools/src/base/linuxthreads.cc
@@ -207,7 +207,8 @@
 static void SignalHandler(int signum, siginfo_t *si, void *data) {
   if (sig_pids != NULL) {
     if (signum == SIGABRT) {
-      while (sig_num_threads-- > 0) {
+      while (sig_num_threads > 0) {
+        sig_num_threads = sig_num_threads - 1;
         /* Not sure if sched_yield is really necessary here, but it does not */
         /* hurt, and it might be necessary for the same reasons that we have */
         /* to do so in sys_ptrace_detach().                                  */
@@ -342,7 +343,8 @@
      * check there first, and then fall back on the older naming
      * convention if necessary.
      */
-    if ((sig_proc = proc = c_open(*proc_path, O_RDONLY|O_DIRECTORY, 0)) < 0) {
+    sig_proc = proc = c_open(*proc_path, O_RDONLY|O_DIRECTORY, 0);
+    if (sig_proc < 0) {
       if (*++proc_path != NULL)
         continue;
       goto failure;
diff --git a/third_party/gperftools/src/sampler.h b/third_party/gperftools/src/sampler.h
index 82b1e67..0a281c5 100644
--- a/third_party/gperftools/src/sampler.h
+++ b/third_party/gperftools/src/sampler.h
@@ -207,7 +207,7 @@
     // sub <reg>, <mem> instruction for subtraction above.
     volatile ssize_t *ptr =
         const_cast<volatile ssize_t *>(&bytes_until_sample_);
-    *ptr += k;
+    *ptr = *ptr + k;
     return false;
   }
   return true;
diff --git a/third_party/gperftools/src/tests/malloc_hook_test.cc b/third_party/gperftools/src/tests/malloc_hook_test.cc
index a5cd860..6dc807b 100644
--- a/third_party/gperftools/src/tests/malloc_hook_test.cc
+++ b/third_party/gperftools/src/tests/malloc_hook_test.cc
@@ -255,7 +255,7 @@
   {
     MutexLock ml(&threadcount_lock);
     assert(num_threads_remaining > 0);
-    --num_threads_remaining;
+    num_threads_remaining = num_threads_remaining - 1;
 
     // We should use condvars and the like, but for this test, we'll
     // go simple and busy-wait.
diff --git a/third_party/gperftools/src/tests/tcmalloc_unittest.cc b/third_party/gperftools/src/tests/tcmalloc_unittest.cc
index 658772f..8ad282a 100644
--- a/third_party/gperftools/src/tests/tcmalloc_unittest.cc
+++ b/third_party/gperftools/src/tests/tcmalloc_unittest.cc
@@ -781,9 +781,9 @@
 // Note the ... in the hook signature: we don't care what arguments
 // the hook takes.
 #define MAKE_HOOK_CALLBACK(hook_type, ...)                              \
-  static volatile int g_##hook_type##_calls = 0;                                 \
+  static volatile int g_##hook_type##_calls = 0;                        \
   static void IncrementCallsTo##hook_type(__VA_ARGS__) {                \
-    g_##hook_type##_calls++;                                            \
+    g_##hook_type##_calls = g_##hook_type##_calls + 1;                  \
   }                                                                     \
   static void Verify##hook_type##WasCalled() {                          \
     CHECK_GT(g_##hook_type##_calls, 0);                                 \