OSDN Git Service

use the correct attributes for ___errno_location
authorSamuel Holland <samuel@sholland.org>
Sat, 29 Jun 2019 23:19:05 +0000 (18:19 -0500)
committerRich Felker <dalias@aerifal.cx>
Wed, 10 Jul 2019 21:10:59 +0000 (17:10 -0400)
In the public header, __errno_location is declared with the "const"
attribute, conditional on __GNUC__. Ensure that its internal alias has
the same attributes.

Maintainer's note: This change also fixes a regression in quality of
code generation -- multiple references to errno in a single function
started generating multiple calls again -- introduced by commit
e13063aad7aee341d278d2a879a76ec7b59b2ad8.

src/include/errno.h

index 54a38ff..8ec4937 100644 (file)
@@ -3,6 +3,9 @@
 
 #include "../../include/errno.h"
 
+#ifdef __GNUC__
+__attribute__((const))
+#endif
 hidden int *___errno_location(void);
 
 #undef errno