NagiosEnterprises / nagioscore

Nagios Core
GNU General Public License v2.0
1.48k stars 440 forks source link

Type uint is undefined on musl #952

Closed orlitzky closed 3 months ago

orlitzky commented 3 months ago

When building nagios against the musl C library, the type uint is undefined. This leads to a few errors, the tl;dr of which is

t-utils.c:139:21: error: unknown type name 'uint'; did you mean 'int'?
  139 | int ok_uint(uint a, uint b, const char *name)
      |                     ^~~~
      |                     int

The root cause of this is that while uint is usually an alias for unsigned int, it actually isn't part of the C standard. Musl does have the uint typedef available in <sys/types.h>, but the simplest fix would be to find & replace uint with either unsigned or unsigned int. Then the header is not needed.

sawolf commented 3 months ago

Thanks for the report! We'll get this resolved for next release.

orlitzky commented 3 months ago

That was fast, thanks. I backported your patch to our Gentoo package for nagios-4.5.1 so we're about to find out if it works :)