On Thu,  3 Sep 2015 23:33:29 +0200
Bernhard Nortmann <[email protected]> wrote:

> With glibc 2.20 (and newer), defining _BSD_SOURCE will now
> generate compiler warnings similar to:
> 
> /usr/include/features.h:148:3: warning: #warning "_BSD_SOURCE
> and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE" [-Wcpp]
> 
> See the glibc 2.20 release notes, https://lwn.net/Articles/611162/.
> 
> This patch contains the recommended changes from _BSD_SOURCE
> to _DEFAULT_SOURCE.
>
> Signed-off-by: Bernhard Nortmann <[email protected]>

http://man7.org/linux/man-pages/man7/feature_test_macros.7.html

   "To allow code that requires _BSD_SOURCE in glibc 2.19 and earlier
   and _DEFAULT_SOURCE in glibc 2.20 and later to compile without
   warnings, define both _BSD_SOURCE and _DEFAULT_SOURCE."

So we just need to define both.

Sigh. I wonder who has come up with this ridiculous rename idea in
the first place? Now suddenly there is some work to do for us and
the others, which serves no real purpose...

It might be even better to just reimplement the non-portable htole32
and letoh32 functions. They only need a few lines of code and the
speed of the operations done with their help is not critical to us.
But I'm not really asking you to do this right now.

> ---
>  fel.c          | 4 ++--
>  phoenix_info.c | 4 ++--
>  pio.c          | 4 ++--
>  3 files changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/fel.c b/fel.c
> index ec9a3ed..78c1465 100644
> --- a/fel.c
> +++ b/fel.c
> @@ -15,8 +15,8 @@
>   * along with this program.  If not, see <http://www.gnu.org/licenses/>.
>   */
>  
> -/* Needs _BSD_SOURCE for htole and letoh  */
> -#define _BSD_SOURCE
> +/* Needs _DEFAULT_SOURCE for htole and letoh  */
> +#define _DEFAULT_SOURCE
>  #define _NETBSD_SOURCE
>  
>  #include <libusb.h>
> diff --git a/phoenix_info.c b/phoenix_info.c
> index b76c5e4..c897ccf 100644
> --- a/phoenix_info.c
> +++ b/phoenix_info.c
> @@ -15,8 +15,8 @@
>   * along with this program.  If not, see <http://www.gnu.org/licenses/>.
>   */
>  
> -/* Needs _BSD_SOURCE for htole and letoh  */
> -#define _BSD_SOURCE
> +/* Needs _DEFAULT_SOURCE for htole and letoh  */
> +#define _DEFAULT_SOURCE
>  
>  #include <stdio.h>
>  #include <stdlib.h>
> diff --git a/pio.c b/pio.c
> index 7ef4514..66a99ff 100644
> --- a/pio.c
> +++ b/pio.c
> @@ -17,8 +17,8 @@
>   * MA 02111-1307 USA
>   */
>  
> -/* needs _BSD_SOURCE for htole and letoh  */
> -#define _BSD_SOURCE
> +/* needs _DEFAULT_SOURCE for htole and letoh  */
> +#define _DEFAULT_SOURCE
>  
>  #include <errno.h>
>  #include <stdio.h>



-- 
Best regards,
Siarhei Siamashka

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to