acerion / cwdaemon

Morse code daemon for unix systems
GNU General Public License v2.0
14 stars 5 forks source link

example.c:108:44: error: dereferencing pointer to incomplete type ‘struct addrinfo’ #1

Open toralf opened 8 years ago

toralf commented 8 years ago

https://bugs.gentoo.org/show_bug.cgi?id=569970

dl1jbe commented 8 years ago

The problem exist with newer GCC>=5 which uses -std=gnu11. It can be fixed by compiling the source with -D_GNU_SOURCE. 73, de Tom DL1JBE

acerion commented 8 years ago

On 29.12.2015 07:26, Thomas Beierlein wrote:

The problem exist with newer GCC>=5 which uses -std=gnu11. It can be fixed by compiling the source with -D_GNU_SOURCE. 73, de Tom DL1JBE

— Reply to this email directly or view it on GitHub https://github.com/acerion/cwdaemon/issues/1#issuecomment-167729041.

Thank you all for reporting the issue and investigating it.

None of my computers is bleeding-edge enough to have gcc5 installed (I have 4.9.2), so testing it with gcc5 is out of question for now.

Build system for cwdaemon already enforces -std=c99 for all build targets, so I think that this flag is not related. Additionally I've tried to build the package with -std=gnu11, but I had no problems with building.

examples/example.c contains all necessary #includes and #defines, as specified in man page for struct addrinfo, so this is even more mysterious.

I will keep the bug open. During next dev cycle for cwdaemon I will make sure to install gcc5 and see if I can replicate this. Who knows, maybe I will even install gentoo :)

Thanks again! Kamil/upstream dev.

dl1jbe commented 8 years ago

Am Mon, 04 Jan 2016 10:27:47 -0800 schrieb acerion notifications@github.com:

On 29.12.2015 07:26, Thomas Beierlein wrote:

The problem exist with newer GCC>=5 which uses -std=gnu11. It can be fixed by compiling the source with -D_GNU_SOURCE. 73, de Tom DL1JBE

— Reply to this email directly or view it on GitHub https://github.com/acerion/cwdaemon/issues/1#issuecomment-167729041.

Thank you all for reporting the issue and investigating it.

None of my computers is bleeding-edge enough to have gcc5 installed (I have 4.9.2), so testing it with gcc5 is out of question for now.

Build system for cwdaemon already enforces -std=c99 for all build targets, so I think that this flag is not related. Additionally I've tried to build the package with -std=gnu11, but I had no problems with building.

examples/example.c contains all necessary #includes and #defines, as specified in man page for struct addrinfo, so this is even more mysterious.

I had to learn myself in these case to read the man page a little bit more thoroughly. Just have a look for the mentioned feature test macros which needs to be defined. The mentioned _GNU_SOURCE is some kind of joker which enables all of the different feature test macros.

A web search for "feature test macros" should give you some more background.

73, de Tom DL1JBE

I will keep the bug open. During next dev cycle for cwdaemon I will make sure to install gcc5 and see if I can replicate this. Who knows, maybe I will even install gentoo :)

Thanks again! Kamil/upstream dev.


Reply to this email directly or view it on GitHub: https://github.com/acerion/cwdaemon/issues/1#issuecomment-168759977

"Do what is needful!"

Ursula LeGuin: Earthsea

acerion commented 8 years ago

There is a big chance that commit b15cd30 fixes this issue. I didn't test this with gcc5 yet, but build logs for i386 on debian.org suggest that cwdaemon 0.10.2 with Debian patches (that include this fix) compiles correctly with gcc 5.3.1.

I'm leaving the issue still open because I didn't test this yet myself.

toralf commented 8 years ago

In Gentoo ::: "OK. The code needs an -D_GNU_SOURCE with newer compilers. Fixed version in tree. Thanks."