[Issue] maybe-uninitialized compilation error #113

Closed
opened 2020-04-12 00:11:11 +02:00 by nlgranger · 1 comment
nlgranger commented 2020-04-12 00:11:11 +02:00 (Migrated from github.com)

Describe the issue
When building glewlwyd 2.2.0, a maybe-uninitialized warning is raised and treated as an error.

glewlwyd/src/glewlwyd-2.2.0/src/scheme/oauth2.c: In function 'user_auth_scheme_module_init':
glewlwyd/src/glewlwyd-2.2.0/src/scheme/oauth2.c:184:23: error: 'name' may be used uninitialized in this function [-Werror=maybe-uninitialized]
  184 |             message = msprintf("enabled is optional and must be a boolean for provider '%s' at index %zu", name, index);
      |                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
glewlwyd/src/glewlwyd-2.2.0/src/scheme/oauth2.c:70:16: note: 'name' was declared here
   70 |   const char * name;
      |                ^~~~

To Reproduce

Expected behavior
Compilation runs smoothly.

System (please complete the following information):

  • OS/Environment : Archlinux
  • Glewlwyd Version: 2.2.0
  • Source installation: build from source
  • If applicable, what option did you use to build Glewlwyd: -DCMAKE_INSTALL_PREFIX=/usr

Additional context
Installed packages:

  • libmicrohttpd
  • libnghttp2>=0.9.70
  • sqlite
  • mariadb-libs
  • postgresql-libs
  • gnutls
  • libconfig
  • libldap
  • oath-toolkit
  • libjwt
  • libcbor
**Describe the issue** When building glewlwyd 2.2.0, a maybe-uninitialized warning is raised and treated as an error. ``` glewlwyd/src/glewlwyd-2.2.0/src/scheme/oauth2.c: In function 'user_auth_scheme_module_init': glewlwyd/src/glewlwyd-2.2.0/src/scheme/oauth2.c:184:23: error: 'name' may be used uninitialized in this function [-Werror=maybe-uninitialized] 184 | message = msprintf("enabled is optional and must be a boolean for provider '%s' at index %zu", name, index); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ glewlwyd/src/glewlwyd-2.2.0/src/scheme/oauth2.c:70:16: note: 'name' was declared here 70 | const char * name; | ^~~~ ``` **To Reproduce** **Expected behavior** Compilation runs smoothly. **System (please complete the following information):** - OS/Environment : Archlinux - Glewlwyd Version: 2.2.0 - Source installation: build from source - If applicable, what option did you use to build Glewlwyd: `-DCMAKE_INSTALL_PREFIX=/usr` **Additional context** Installed packages: - libmicrohttpd - libnghttp2>=0.9.70 - sqlite - mariadb-libs - postgresql-libs - gnutls - libconfig - libldap - oath-toolkit - libjwt - libcbor
babelouest commented 2020-04-12 01:19:04 +02:00 (Migrated from github.com)

Hello @nlgranger ,

Thanks for pointing out! This looks like a gcc-9 I have a über balaise powerful static analyzer. The commit github.com/babelouest/glewlwyd@84e156f7c8 should fix it.

Hello @nlgranger , Thanks for pointing out! This looks like a gcc-9 `I have a über balaise powerful` static analyzer. The commit https://github.com/babelouest/glewlwyd/commit/84e156f7c8c776706bc47c2c85c704c5d73959fe should fix it.
This discussion has been locked. Commenting is limited to contributors.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
KittenSquad/glewlwyd#113
No description provided.