How to suggest fixes to libraries?

There's a minor bug in
Arduino/libraries/Adafruit_FreeTouch_Library/Adafruit_FreeTouch.cpp
and while it's not affecting my projects, it generates a warning when I compile with warnings enabled, which is annoying.

Around line 111 we find:

  uint16_t m;

  m = measureRaw();
  if (m == -1)

And the if is never going to be true, because in C++ the (32 bit integer value) -1 is going to be promoted to 0xffffffffU which is never going to compare equal to a 16 bit value. Basically, the error check is never going to work. And if the error does happen, the oversample conversion could then return a surprise value that looks like success.

g++ can see the problem and warns about it, which tells me the library was provided without anyone checking warnings.

And while it's not a bug and more of a style issue, it would be nice if the library would stop returning -1 as an error, since it's using unsigned values and it's going to lead other people to make mistakes like the one at 111. 0xffffU would be less confusing, as that's what's actually going to happen anyway.

The library repository GitHub - adafruit/Adafruit_FreeTouch: A QTouch-compatible library would be the place to report issues.

The code should probably have been written with 0xFFFF instead of -1, particularly since the measureRaw() function returns a uint16_t.

I have a lot more problems with the flood of warnings that the #if compiler directive may not be portable.
I see that is not from this library, but from the sam.h library file.

scottmayo:
g++ can see the problem and warns about it, which tells me the library was provided without anyone checking warnings.

This is more common than you would like. I've recently started reporting all warnings- I think this will make me a better programmer by fixing warnings before an update to the compiler turns them into errors. What I have discovered is many libraries are, as you observed, released without checking for warnings.

When writing library stuff, I always have all warnings on, so I can avoid creating software that reports warnings when compiled.

It stops people reporting warnings as 'issues' with the library.