From: Alex Colomar Date: Sat, 10 Sep 2022 21:28:15 +0000 (+0200) Subject: _Generic.3: EXAMPLES: Allow taking a pointer to &my_imaxabs X-Git-Tag: man-pages-6.00~48 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a98bd8eb3033819b3a03e75c75c8bac4737e4ff4;p=thirdparty%2Fman-pages.git _Generic.3: EXAMPLES: Allow taking a pointer to &my_imaxabs And show the pointer value in the example, and show also those of &labs and &llabs to compare. Cc: JeanHeyd Meneide Cc: Florian Weimer Cc: "G. Branden Robinson" Cc: Ingo Schwarze Signed-off-by: Alex Colomar --- diff --git a/man3/_Generic.3 b/man3/_Generic.3 index f3daf98c1a..87115e334d 100644 --- a/man3/_Generic.3 +++ b/man3/_Generic.3 @@ -39,10 +39,10 @@ seamlessly upgrading to the widest available type. #include #include -#define my_imaxabs(j) _Generic(INTMAX_C(0), \e - long: labs(j), \e - long long: llabs(j) \e - /* long long long: lllabs(j) */ \e +#define my_imaxabs _Generic(INTMAX_C(0), \e + long: labs, \e + long long: llabs \e + /* long long long: lllabs */ \e ) int @@ -52,6 +52,9 @@ main(void) a = \-42; printf("imaxabs(%jd) == %jd\en", (intmax_t) a, my_imaxabs(a)); + printf("&imaxabs == %p\en", &my_imaxabs); + printf("&labs == %p\en", &labs); + printf("&llabs == %p\en", &llabs); exit(EXIT_SUCCESS); }