BPF List
 help / color / mirror / Atom feed
* [PATCH bpf v1] selftests/bpf: Fix undefined UINT_MAX in veristat.c
@ 2025-01-16  7:50 Tony Ambardar
  2025-01-16 23:30 ` patchwork-bot+netdevbpf
  0 siblings, 1 reply; 2+ messages in thread
From: Tony Ambardar @ 2025-01-16  7:50 UTC (permalink / raw)
  To: bpf
  Cc: Tony Ambardar, Alexei Starovoitov, Daniel Borkmann,
	Andrii Nakryiko, Martin KaFai Lau, Eduard Zingerman, Song Liu,
	Yonghong Song, John Fastabend, KP Singh, Stanislav Fomichev,
	Hao Luo, Jiri Olsa, Mykola Lysenko, Shuah Khan, Mykyta Yatsenko

Include <limits.h> in 'veristat.c' to provide a UINT_MAX definition and
avoid multiple compile errors against mips64el/musl-libc:

veristat.c: In function 'max_verifier_log_size':
veristat.c:1135:36: error: 'UINT_MAX' undeclared (first use in this function)
 1135 |         const int SMALL_LOG_SIZE = UINT_MAX >> 8;
      |                                    ^~~~~~~~
veristat.c:24:1: note: 'UINT_MAX' is defined in header '<limits.h>'; did you forget to '#include <limits.h>'?
   23 | #include <math.h>
  +++ |+#include <limits.h>
   24 |

CC: Mykyta Yatsenko <yatsenko@meta.com>
Fixes: 1f7c33630724 ("selftests/bpf: Increase verifier log limit in veristat")
Signed-off-by: Tony Ambardar <tony.ambardar@gmail.com>
---
 tools/testing/selftests/bpf/veristat.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/testing/selftests/bpf/veristat.c b/tools/testing/selftests/bpf/veristat.c
index 8dcf5ee000ca..c72111dfb35d 100644
--- a/tools/testing/selftests/bpf/veristat.c
+++ b/tools/testing/selftests/bpf/veristat.c
@@ -21,6 +21,7 @@
 #include <gelf.h>
 #include <float.h>
 #include <math.h>
+#include <limits.h>
 
 #ifndef ARRAY_SIZE
 #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH bpf v1] selftests/bpf: Fix undefined UINT_MAX in veristat.c
  2025-01-16  7:50 [PATCH bpf v1] selftests/bpf: Fix undefined UINT_MAX in veristat.c Tony Ambardar
@ 2025-01-16 23:30 ` patchwork-bot+netdevbpf
  0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2025-01-16 23:30 UTC (permalink / raw)
  To: Tony Ambardar
  Cc: bpf, ast, daniel, andrii, martin.lau, eddyz87, song,
	yonghong.song, john.fastabend, kpsingh, sdf, haoluo, jolsa,
	mykolal, shuah, yatsenko

Hello:

This patch was applied to bpf/bpf-next.git (master)
by Andrii Nakryiko <andrii@kernel.org>:

On Wed, 15 Jan 2025 23:50:36 -0800 you wrote:
> Include <limits.h> in 'veristat.c' to provide a UINT_MAX definition and
> avoid multiple compile errors against mips64el/musl-libc:
> 
> veristat.c: In function 'max_verifier_log_size':
> veristat.c:1135:36: error: 'UINT_MAX' undeclared (first use in this function)
>  1135 |         const int SMALL_LOG_SIZE = UINT_MAX >> 8;
>       |                                    ^~~~~~~~
> veristat.c:24:1: note: 'UINT_MAX' is defined in header '<limits.h>'; did you forget to '#include <limits.h>'?
>    23 | #include <math.h>
>   +++ |+#include <limits.h>
>    24 |
> 
> [...]

Here is the summary with links:
  - [bpf,v1] selftests/bpf: Fix undefined UINT_MAX in veristat.c
    https://git.kernel.org/bpf/bpf-next/c/a8d1c48d0720

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-01-16 23:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-16  7:50 [PATCH bpf v1] selftests/bpf: Fix undefined UINT_MAX in veristat.c Tony Ambardar
2025-01-16 23:30 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox