Hi Martin,

On 06/21/2019 04:56 AM, Martin Hundebøll wrote:
Fixes:

../git/drivers/ubloxmodem/gprs-context.c: In function 
‘ublox_gprs_activate_primary’:
../git/drivers/ubloxmodem/gprs-context.c:339:2: error: ‘auth’ may be used 
uninitialized in this function [-Werror=maybe-uninitialized]
   snprintf(buf, sizeof(buf), "AT+UAUTHREQ=%u,%u,\"%s\",\"%s\"",
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     gcd->active_context, auth, username, password);
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../git/drivers/ubloxmodem/gprs-context.c:324:11: note: ‘auth’ was declared here
   unsigned auth;

What compiler are you using? gcc really needs to make up its mind whether it warns about enums or doesn't. The behavior between versions is nuts.

            ^~~~
---
  drivers/ubloxmodem/gprs-context.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/ubloxmodem/gprs-context.c 
b/drivers/ubloxmodem/gprs-context.c
index 489f31e8..c5b789b6 100644
--- a/drivers/ubloxmodem/gprs-context.c
+++ b/drivers/ubloxmodem/gprs-context.c
@@ -321,7 +321,7 @@ static void ublox_send_uauthreq(struct ofono_gprs_context 
*gc,
  {
        struct gprs_context_data *gcd = ofono_gprs_context_get_data(gc);
        char buf[UBLOX_MAX_USER_LEN + UBLOX_MAX_PASS_LEN + 32];
-       unsigned auth;
+       unsigned auth = 0;
switch (auth_method) {
        case OFONO_GPRS_AUTH_METHOD_PAP:


anyhow, applied, thanks.

Regards,
-Denis
_______________________________________________
ofono mailing list
[email protected]
https://lists.ofono.org/mailman/listinfo/ofono

Reply via email to