Clang doesn't implement this attribute and reports an error. Work
around it by hiding it in a macro that will be empty in clang.
Reported-by: Christian Göttsche <cgzones@googlemail.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
/* Maximum length of passwd entry */
#define PASSWD_ENTRY_MAX_LENGTH 32768
+#if (__GNUC__ >= 11) && !defined(__clang__)
+# define ATTR_MALLOC(deallocator) [[gnu::malloc(deallocator)]]
+#else
+# define ATTR_MALLOC(deallocator)
+#endif
+
#ifdef HAVE_SECURE_GETENV
# define shadow_getenv(name) secure_getenv(name)
# else
/* agetpass.c */
extern void erase_pass(char *pass);
-[[gnu::malloc(erase_pass)]]
+ATTR_MALLOC(erase_pass)
extern char *agetpass(const char *prompt);
/* isexpired.c */