Don't redefine errno(3)
It is Undefined Behavior to declare errno (see NOTES in its manual page). Instead of using the errno dummy declaration, use one that doesn't need a comment. Signed-off-by: Alejandro Colomar <alx@kernel.org>
This commit is contained in:
committed by
Iker Pedrosa
parent
ed69feaaff
commit
e2df287aad
@@ -502,5 +502,5 @@ int putsgent (const struct sgrp *sgrp, FILE * fp)
|
||||
return 0;
|
||||
}
|
||||
#else
|
||||
extern int errno; /* warning: ANSI C forbids an empty source file */
|
||||
extern int ISO_C_forbids_an_empty_translation_unit;
|
||||
#endif /*} SHADOWGRP */
|
||||
|
@@ -81,5 +81,5 @@ int ulckpwdf (void)
|
||||
return (pw_unlock () && spw_unlock ())? 0 : -1;
|
||||
}
|
||||
#else
|
||||
extern int errno; /* warning: ANSI C forbids an empty source file */
|
||||
extern int ISO_C_forbids_an_empty_translation_unit;
|
||||
#endif
|
||||
|
@@ -53,6 +53,6 @@ int nscd_flush_cache (const char *service)
|
||||
return 0;
|
||||
}
|
||||
#else /* USE_NSCD */
|
||||
extern int errno; /* warning: ANSI C forbids an empty source file */
|
||||
extern int ISO_C_forbids_an_empty_translation_unit;
|
||||
#endif /* USE_NSCD */
|
||||
|
||||
|
@@ -207,5 +207,5 @@ int pw_auth (const char *cipher,
|
||||
return retval;
|
||||
}
|
||||
#else /* !USE_PAM */
|
||||
extern int errno; /* warning: ANSI C forbids an empty source file */
|
||||
extern int ISO_C_forbids_an_empty_translation_unit;
|
||||
#endif /* !USE_PAM */
|
||||
|
@@ -206,5 +206,5 @@ int check_selinux_permit (const char *perm_name)
|
||||
}
|
||||
|
||||
#else /* !WITH_SELINUX */
|
||||
extern int errno; /* warning: ANSI C forbids an empty source file */
|
||||
extern int ISO_C_forbids_an_empty_translation_unit;
|
||||
#endif /* !WITH_SELINUX */
|
||||
|
@@ -357,5 +357,5 @@ done:
|
||||
return ret;
|
||||
}
|
||||
#else /* !WITH_SELINUX */
|
||||
extern int errno; /* warning: ANSI C forbids an empty source file */
|
||||
extern int ISO_C_forbids_an_empty_translation_unit;
|
||||
#endif /* !WITH_SELINUX */
|
||||
|
@@ -182,6 +182,6 @@ struct spwd *sgetspent (const char *string)
|
||||
return (&spwd);
|
||||
}
|
||||
#else
|
||||
extern int errno; /* warning: ANSI C forbids an empty source file */
|
||||
extern int ISO_C_forbids_an_empty_translation_unit;
|
||||
#endif
|
||||
|
||||
|
@@ -302,5 +302,5 @@ int sgr_sort ()
|
||||
return commonio_sort_wrt (&gshadow_db, __gr_get_db ());
|
||||
}
|
||||
#else
|
||||
extern int errno; /* warning: ANSI C forbids an empty source file */
|
||||
extern int ISO_C_forbids_an_empty_translation_unit;
|
||||
#endif
|
||||
|
@@ -525,6 +525,6 @@ struct spwd *getspnam (const char *name)
|
||||
return (sp);
|
||||
}
|
||||
#else
|
||||
extern int errno; /* warning: ANSI C forbids an empty source file */
|
||||
extern int ISO_C_forbids_an_empty_translation_unit;
|
||||
#endif
|
||||
|
||||
|
@@ -70,6 +70,6 @@ int sssd_flush_cache (int dbflags)
|
||||
return 0;
|
||||
}
|
||||
#else /* USE_SSSD */
|
||||
extern int errno; /* warning: ANSI C forbids an empty source file */
|
||||
extern int ISO_C_forbids_an_empty_translation_unit;
|
||||
#endif /* USE_SSSD */
|
||||
|
||||
|
@@ -1097,6 +1097,6 @@ bool release_subid_range(struct subordinate_range *range, enum subid_type id_typ
|
||||
}
|
||||
|
||||
#else /* !ENABLE_SUBIDS */
|
||||
extern int errno; /* warning: ANSI C forbids an empty source file */
|
||||
extern int ISO_C_forbids_an_empty_translation_unit;
|
||||
#endif /* !ENABLE_SUBIDS */
|
||||
|
||||
|
@@ -66,5 +66,5 @@ struct utmp *getutent (void)
|
||||
return &utmp_buf;
|
||||
}
|
||||
#else
|
||||
extern int errno; /* warning: ANSI C forbids an empty source file */
|
||||
extern int ISO_C_forbids_an_empty_translation_unit;
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user