[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lwip-devel] [bug #55034] apps/smtp.c fails to compile with strict C com
From: |
Niklas Gürtler |
Subject: |
[lwip-devel] [bug #55034] apps/smtp.c fails to compile with strict C compatibility because of strnlen |
Date: |
Fri, 16 Nov 2018 06:28:26 -0500 (EST) |
User-agent: |
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:63.0) Gecko/20100101 Firefox/63.0 |
URL:
<https://savannah.nongnu.org/bugs/?55034>
Summary: apps/smtp.c fails to compile with strict C
compatibility because of strnlen
Project: lwIP - A Lightweight TCP/IP stack
Submitted by: erlkoenig
Submitted on: Fri 16 Nov 2018 11:28:25 AM UTC
Category: apps
Severity: 3 - Normal
Item Group: Compiler Warning
Status: None
Privacy: Public
Assigned to: None
Open/Closed: Open
Discussion Lock: Any
Planned Release: None
lwIP version: 2.1.1
_______________________________________________________
Details:
Dear lwIP maintainers,
the apps/smtp.c file fails to compile if the compiler is configured to
strictly observe the C standard (e.g. -std=c11 for GCC), because strnlen is a
POSIX function but not defined by the C standard. Simply setting -std=gnu11
does not work with e.g. newlib, because this results in some system header
#defining BYTE_ORDER, which then conflicts with the BYTE_ORDER from arch.h.
I think the best solution is to either avoid strnlen, or add a "#define
_POSIX_C_SOURCE 200809L" to the top of smtp.h (before all #include's) to
enable strnlen for C libraries that support it (including newlib).
Thanks & greetings,
Niklas
_______________________________________________________
File Attachments:
-------------------------------------------------------
Date: Fri 16 Nov 2018 11:28:25 AM UTC Name: patch-strnlen-posix.txt Size:
281B By: erlkoenig
Patch to add _POSIX_C_SOURCE macro to smtp.c
<http://savannah.nongnu.org/bugs/download.php?file_id=45443>
_______________________________________________________
Reply to this item at:
<https://savannah.nongnu.org/bugs/?55034>
_______________________________________________
Message sent via Savannah
https://savannah.nongnu.org/
- [lwip-devel] [bug #55034] apps/smtp.c fails to compile with strict C compatibility because of strnlen,
Niklas Gürtler <=