Skip to main content
Home
for DLMS smart meters
Open source solutions for DLMS smart metering

Main navigation

  • Home
  • Products
  • About us
  • Open Source
  • Community
  • Forum
  • Downloads
User account menu
  • Log in

Breadcrumb

  1. Home
  2. Forums
  3. Compilation Warnings

Compilation Warnings

Forum Rules

Before commenting read Forum rules

Don't comment the topic if you have a new question.

You can create a new topic selecting correct category from Gurux Forum and then create a new topic selecting "New Topic" from the top left.

By José Torres , 5 August, 2020
Forums
General discussion

Hi,

I just compiled gurux.dlms.c client demo and got 2 warnings that migth cause some problem:

src/gxset.c: In function ‘cosem_setSwitchTable’:
src/gxset.c:7811:44: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]

src/gxvalueeventargs.c:64:15: warning: assignment to ‘gxValueEventArg **’ {aka ‘struct <anonymous> **’} from incompatible pointer type ‘gxValueEventArg *’ {aka ‘struct <anonymous> *’} [-
Wincompatible-pointer-types]

Is there any policy regarding warnings?

Thanks,
Torres

Profile picture for user Kurumi

Kurumi

5 years 10 months ago

Hi Torres,

Hi Torres,

Thank you for this info. Those warnings are now fixed. We try to make a new release tomorrow.

BR,
Mikko

José Torres

5 years 10 months ago

Hi Mikko,

Hi Mikko,
thanks for the reply. These warnings are the ones that I think could be critical, but there are a lot more regarding unused variables and use o uninitialized variables...
Any way, thanks for promptly response.
Best Regards,
José Torres.

Profile picture for user Kurumi

Kurumi

5 years 10 months ago

Hi,

Hi,

What compiler you are using?

BR,
Mikko

José Torres

5 years 10 months ago

Hi Mikko,

Hi Mikko,
I am using gcc GNU Tools for STM32, version 7-2018-q2-update, with the following flags:
-mcpu=cortex-m4 -std=gnu11 -g3 -Og -ffunction-sections -fdata-sections -Wall -Wextra -fstack-usage --specs=nano.specs -mfpu=fpv4-sp-d16 -mfloat-abi=hard -mthumb.
However, I have used also gcc from cygwin on Windows 10 and get the warnings too.
Regards,
José Torres

Profile picture for user Kurumi

Kurumi

5 years 10 months ago

Hi José,

Hi José,

Have you got the latest version from Github? We are also using Cygwin, but I just realized that we are not using malloc with it (DLMS_IGNORE_MALLOC). We'll check this with the malloc to see if we can get more errors.

BR,
Mikko

José Torres

5 years 10 months ago

Hi Mikko,

Hi Mikko,

After update to the latest version from GitHub, I got the following warnings when compiling for STM32:

gurux/src/dlms.c:1532:9: warning: unused parameter 'len' [-Wunused-parameter]
gurux/src/dlms.c:1706:19: warning: unused parameter 'settings' [-Wunused-parameter]
gurux/src/dlms.c:4239:19: warning: unused parameter 'first' [-Wunused-parameter]
gurux/src/dlms.c:2474:12: warning: 'len' may be used uninitialized in this function [-Wmaybe-uninitialized]
gurux/src/gxarray.c:226:74: warning: unused parameter 'itemSize' [-Wunused-parameter]
gurux/src/gxget.c:819:19: warning: unused parameter 'settings' [-Wunused-parameter]
gurux/src/gxinvoke.c:1607:25: warning: unused parameter 'settings' [-Wunused-parameter]
gurux/src/gxget.c:4890:19: warning: unused parameter 'settings' [-Wunused-parameter]
gurux/src/gxget.c:4894:19: warning: unused parameter 'appendAA' [-Wunused-parameter]
gurux/src/gxget.c:807:20: warning: 'pduSize' may be used uninitialized in this function [-Wmaybe-uninitialized]
gurux/src/gxget.c:1139:18: warning: 'pduSize' may be used uninitialized in this function [-Wmaybe-uninitialized]
gurux/src/gxget.c:2250:18: warning: 'pduSize' may be used uninitialized in this function [-Wmaybe-uninitialized]
gurux/src/gxget.c:2385:20: warning: 'pduSize' may be used uninitialized in this function [-Wmaybe-uninitialized]
gurux/src/gxset.c:7552:19: warning: unused parameter 'settings' [-Wunused-parameter]
gurux/src/gxset.c:7576:19: warning: unused parameter 'settings' [-Wunused-parameter]
gurux/src/gxset.c:7607:19: warning: unused parameter 'settings' [-Wunused-parameter]
gurux/src/gxset.c:7646:19: warning: unused parameter 'settings' [-Wunused-parameter]
gurux/src/gxset.c:7703:19: warning: unused parameter 'settings' [-Wunused-parameter]
gurux/src/gxset.c:8093:19: warning: unused parameter 'settings' [-Wunused-parameter]
gurux/src/gxset.c:8127:19: warning: unused parameter 'settings' [-Wunused-parameter]
gurux\include\gxmem.h:48:30: warning: 'ipcpItem' may be used uninitialized in this function [-Wmaybe-uninitialized]
gurux/src/gxset.c:4534:9: warning: 'ret' may be used uninitialized in this function [-Wmaybe-uninitialized]
gurux/src/gxset.c:4992:9: warning: 'ret' may be used uninitialized in this function [-Wmaybe-uninitialized]
gurux/src/helpers.c:708:26: warning: unused parameter 'scaler' [-Wunused-parameter]
gurux/src/notify.c:364:43: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
gurux/src/server.c:3248:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
gurux/src/serverevents.c:34:34: warning: unused parameter 'str' [-Wunused-parameter]
gurux/src/serverevents.c:34:43: warning: unused parameter 'err' [-Wunused-parameter]
gurux/src/serverevents.c:50:35: warning: unused parameter 'str' [-Wunused-parameter]
gurux/src/serverevents.c:50:52: warning: unused parameter 'ot' [-Wunused-parameter]
gurux/src/serverevents.c:50:77: warning: unused parameter 'ln' [-Wunused-parameter]
gurux/src/serverevents.c:50:85: warning: unused parameter 'err' [-Wunused-parameter]
gurux/src/variant.c:389:12: warning: this statement may fall through [-Wimplicit-fallthrough=]
gurux/src/variant.c:824:9: warning: 'ret' may be used uninitialized in this function [-Wmaybe-uninitialized]

Regards,
José Torres

Profile picture for user Kurumi

Kurumi

5 years 10 months ago

Hi,

Hi,

Thank you very much for this info. We'll fix those warnings in next week. I believe that must make toolchain for STM32.

BR,

Mikko

José Torres

5 years 10 months ago

Hi Mikko,

Hi Mikko,
no problem, thanks for reply. I am looking forward for the next update.

Best Regards,
José Torres

  • Create new account
  • Reset your password

Hire Us!

Latest Releases

  • Tue, 06/09/2026 - 11:16
    gurux.dlms.java 4.0.95
  • Tue, 06/09/2026 - 10:03
    Gurux.DLMS.Python 1.0.199
  • Mon, 06/08/2026 - 13:39
    gurux.dlms.cpp 9.0.2606.0801
  • Mon, 06/01/2026 - 10:15
    gurux.dlms.cpp 9.0.2606.0101
  • Thu, 05/28/2026 - 16:06
    gurux.dlms.java 4.0.94

New forum topics

  • Error reading L&G Meter
  • Pass a TCP Client to GXNet
  • Australian EDMI Mk10D (Essential Energy area)
  • Strange mix of data notificiation vs get response
  • DLMS Connection
More

Who's new

  • Tuanhgg
  • Adel
  • charnon
  • Paddles
  • Miguel Ángel
RSS feed
Privacy FAQ GXDN Issues Contact
Follow Gurux on Twitter Follow Gurux on Linkedin