Vendor supplied libraries and code regularly have bugs, and even more
regularly have limitations on the optimisation that lets them work (that
is, of course, a kind of bug in the code - the vendor's viewpoint might
be that it is just using the code outside of specifications.
Undocumented specifications, of course).
I've seen vendor code that fails to compile in C99 mode, and is only
usable in C90 mode. (It takes a special kind of imaginative cock-up to
achieve that.) I've seen vendor code that is pointlessly written in
assembly, when simple clear C code would have been much more efficient -
and would not fail to build due to small changes in the compiler flags.
A lot of vendor-supplied code seems to be written by students on summer
jobs. And a lot seems to be hacks and patches built on decades-old code
written for a different type of processor.
But it is IMHO more annoying when it is bugs in the compiler or
compiler-supplied libraries, from suppliers that normally have very high
quality. One that I find particularly irritating is that the
gcc-supplied atomics library for the ARM (I think it is more general
than that, but I use gcc on embedded ARMs) is totally wrong. Spin locks
are /not/ a good idea on single processor systems!