Discussion:
PR #7117 failing, help
Gealber Morales via curl-library
2021-05-23 20:59:43 UTC
Permalink
Hello there, I recently made a pull request #7117
<https://github.com/curl/curl/pull/7117> adding support for
username/password for MQTT in curl.
There's a lot of workflows failing, I will review them one by one, so I'll
be asking here what could be the reason, so any help is welcome.

On the modification that I added I user the function *bzero* and one of the
more frecuents error that I'm getting is this one

mqtt.c:200:3: error: implicit declaration of function 'bzero'
[-Wimplicit-function-declaration]

200 | bzero(packet, packetlen);

| ^~~~~

This failed is on Cirrus CI / Windows 32-bit static/release
Schannel/SSPI/WinIDN/libssh2 workflow. I think the problem is that in this
particular
environment the header #include <strings.h> is not been included, and it
must be for a good reason I think. I checked out* "curl_setup.h" * and I
noticed
that this header is only included under this condition *#ifdef TPF. *So my
question is, instead of *bzero* what should I be using to achieve the same
behavior? O
any idea of how could I solve this.

Greetings Gealber
Gealber Morales via curl-library
2021-05-23 21:06:54 UTC
Permalink
Just find out that bzero
<https://man7.org/linux/man-pages/man3/bzero.3.html#:~:text=The%20bzero()%20function%20is,POSIX.&text=The%20explicit_bzero()%20function%20is,on%20some%20of%20the%20BSDs.>
has been deprecated, my bad

El dom, 23 de may. de 2021 a la(s) 16:59, Gealber Morales (
Post by Gealber Morales via curl-library
Hello there, I recently made a pull request #7117
<https://github.com/curl/curl/pull/7117> adding support for
username/password for MQTT in curl.
There's a lot of workflows failing, I will review them one by one, so I'll
be asking here what could be the reason, so any help is welcome.
On the modification that I added I user the function *bzero* and one of
the more frecuents error that I'm getting is this one
mqtt.c:200:3: error: implicit declaration of function 'bzero'
[-Wimplicit-function-declaration]
200 | bzero(packet, packetlen);
| ^~~~~
This failed is on Cirrus CI / Windows 32-bit static/release
Schannel/SSPI/WinIDN/libssh2 workflow. I think the problem is that in
this particular
environment the header #include <strings.h> is not been included, and it
must be for a good reason I think. I checked out* "curl_setup.h" * and I
noticed
that this header is only included under this condition *#ifdef TPF. *So
my question is, instead of *bzero* what should I be using to achieve the
same behavior? O
any idea of how could I solve this.
Greetings Gealber
Daniel Stenberg via curl-library
2021-05-23 21:09:49 UTC
Permalink
Post by Gealber Morales via curl-library
mqtt.c:200:3: error: implicit declaration of function 'bzero'
[-Wimplicit-function-declaration]
200 | bzero(packet, packetlen);
You musn't use bzero() because it isn't portable enough. Use memset() instead
and there won't be any problems.
--
/ daniel.haxx.se
| Commercial curl support up to 24x7 is available!
| Private help, bug fixes, support, ports, new features
| https://www.wolfssl.com/contact/
-------------------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette:
Continue reading on narkive:
Loading...