[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [lwip-users] Can't build "Working example" from BUILDING
From: |
Grant Edwards |
Subject: |
Re: [lwip-users] Can't build "Working example" from BUILDING |
Date: |
Thu, 30 Sep 2021 15:24:03 -0000 (UTC) |
User-agent: |
slrn/1.0.3 (Linux) |
On 2021-09-30, Grant Edwards <grant.b.edwards@gmail.com> wrote:
> What apprently needs to be done is:
>
> 1. Move 'contrib' directory up one level.
>
> 2. The shell commands shown in section "Working example" should not
> be done in the lwip root directory as stated. They are done in
>
> contib/ports/unix/example_app
>
> That appears to attemp to compile source files. But, that fails also:
>
> $ cmake --build .
> [ 1%] Building C object
> CMakeFiles/makefsdata.dir/home/grante/lwip/lwip/src/apps/http/makefsdata/makefsdata.c.o
> /home/grante/lwip/lwip/src/apps/http/makefsdata/makefsdata.c: In function
> ‘process_file’:
> /home/grante/lwip/lwip/src/apps/http/makefsdata/makefsdata.c:923:32:
> error: ‘sprintf’ may write a terminating nul past the end of the destination
> [-Werror=format-overflow=]
> 923 | sprintf(qualifiedName, "%s/%s", curSubdir, filename);
> | ^
> /home/grante/lwip/lwip/src/apps/http/makefsdata/makefsdata.c:923:3: note:
> ‘sprintf’ output 2 or more bytes (assuming 257) into a destination of size 256
> 923 | sprintf(qualifiedName, "%s/%s", curSubdir, filename);
> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> cc1: all warnings being treated as errors
> gmake[2]: *** [CMakeFiles/makefsdata.dir/build.make:76:
> CMakeFiles/makefsdata.dir/home/grante/lwip/lwip/src/apps/http/makefsdata/makefsdata.c.o]
> Error 1
> gmake[1]: *** [CMakeFiles/Makefile2:91: CMakeFiles/makefsdata.dir/all]
> Error 2
The build steps I'm using must still be wrong, because I can't
believe that release candidate sources won't even compile. But, in a
attempt to make some progress, I changed
lwip/src/apps/http/makefsdata/makefsdata.c
to fix the buffer overflow, and the "Working example" build still fails:
[ 99%] Built target lwipallapps
[ 99%] Building C object
CMakeFiles/example_app.dir/home/grante/lwip/contrib/examples/example_app/test.c.o
/home/grante/lwip/contrib/examples/example_app/test.c:108:10: fatal error:
lwipcfg.h: No such file or directory
108 | #include "lwipcfg.h"
| ^~~~~~~~~~~
compilation terminated.
gmake[2]: *** [CMakeFiles/example_app.dir/build.make:76:
CMakeFiles/example_app.dir/home/grante/lwip/contrib/examples/example_app/test.c.o]
Error 1
gmake[1]: *** [CMakeFiles/Makefile2:122:
CMakeFiles/example_app.dir/all] Error 2
gmake: *** [Makefile:91: all] Error 2
So I'm obviously still doing something wrong, but what?
There must be some sort of working demo/example build documented somewhere?
--
Grant