Skip to content

Conversation

@yeongjoshua
Copy link
Collaborator

No description provided.

@pathakraul
Copy link
Collaborator

I am getting build error with gcc version gcc version 15.2.0 (Ubuntu 15.2.0-4ubuntu4)

~/W/o/v/g/librpmi make CROSS_COMPILE= ARCH=

------------------ LIBRPMI BUILD INFO --------------------
CC:        (cc)
CPP:       (cc -E)
AS:        (as)
AR:        (ar)
LD:        (ld)
ARFLAGS:   (rcs)
CFLAGS:    (-Wall -Werror -g -I/home/rpathak/Work/office/ventana/github/librpmi/include -I/home/rpathak/Work/office/ventana/github/librpmi/lib -O2 -Wsign-compare)
LDFLAGS:   ()
--------------------------------------------------
 CC        lib/rpmi_service_group_device_power.o
 CC        lib/rpmi_service_group_performance.o
 CC        lib/rpmi_service_group_voltage.o
/home/rpathak/Work/office/ventana/github/librpmi/lib/rpmi_service_group_voltage.c: In function ‘rpmi_volt_get_supp_levels’:
/home/rpathak/Work/office/ventana/github/librpmi/lib/rpmi_service_group_voltage.c:438:32: error: ‘volt_attrs.level_array’ may be used uninitialized [-Werror=maybe-uninitialized]
  438 |         if (!num_volt_level || !volt_level_array) {
      |                                ^~~~~~~~~~~~~~~~~
/home/rpathak/Work/office/ventana/github/librpmi/lib/rpmi_service_group_voltage.c:414:35: note: ‘volt_attrs.level_array’ was declared here
  414 |         struct rpmi_voltage_attrs volt_attrs;
      |                                   ^~~~~~~~~~
cc1: all warnings being treated as errors
make: *** [Makefile:196: /home/rpathak/Work/office/ventana/github/librpmi/build/lib/rpmi_service_group_voltage.o] Error 1
~/W/o/v/g/librpmi[2]                                                                                                                                                0.246s
~/W/o/v/g/librpmi[2]                                                                                                                                                0.246s

~/W/o/v/g/librpmi[2] make CROSS_COMPILE= ARCH= LIBRPMI_TEST=y LIBRPMI_DEBUG=y                                                                                       0.246s

------------------ LIBRPMI BUILD INFO --------------------
CC:        (cc)
CPP:       (cc -E)
AS:        (as)
AR:        (ar)
LD:        (ld)
ARFLAGS:   (rcs)
CFLAGS:    (-Wall -Werror -g -I/home/rpathak/Work/office/ventana/github/librpmi/include -I/home/rpathak/Work/office/ventana/github/librpmi/lib -O0 -DDEBUG -Wsign-compare)
LDFLAGS:   ()
--------------------------------------------------
 CC        lib/rpmi_service_group_voltage.o
/home/rpathak/Work/office/ventana/github/librpmi/lib/rpmi_service_group_voltage.c: In function ‘rpmi_service_group_voltage_create’:
/home/rpathak/Work/office/ventana/github/librpmi/lib/rpmi_service_group_voltage.c:645:25: error: format ‘%s’ expects a matching ‘char *’ argument [-Werror=format=]
  645 |                 DPRINTF("%s: failed to initialize voltage tree\n");
      |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/rpathak/Work/office/ventana/github/librpmi/lib/rpmi_service_group_voltage.c:12:49: note: in definition of macro ‘DPRINTF’
   12 | #define DPRINTF(msg...)         rpmi_env_printf(msg)
      |                                                 ^~~
/home/rpathak/Work/office/ventana/github/librpmi/lib/rpmi_service_group_voltage.c:645:27: note: format string is defined here
  645 |                 DPRINTF("%s: failed to initialize voltage tree\n");
      |                          ~^
      |                           |
      |                           char *
cc1: all warnings being treated as errors
make: *** [Makefile:196: /home/rpathak/Work/office/ventana/github/librpmi/build/lib/rpmi_service_group_voltage.o] Error 1

@yeongjoshua
Copy link
Collaborator Author

looks like both of my toolchain does not generate the error mentioned above
1 of the toolchain is internal toolchain and another public toolchain

$ gcc --version
gcc (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0
Copyright (C) 2023 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

@yeongjoshua
Copy link
Collaborator Author

yeongjoshua commented Oct 14, 2025

/home/rpathak/Work/office/ventana/github/librpmi/lib/rpmi_service_group_voltage.c: In function ‘rpmi_volt_get_supp_levels’:
/home/rpathak/Work/office/ventana/github/librpmi/lib/rpmi_service_group_voltage.c:438:32: error: ‘volt_attrs.level_array’ may be used uninitialized [-Werror=maybe-uninitialized]
438 | if (!num_volt_level || !volt_level_array) {
| ^~~~~~~~~~~~~~~~~
/home/rpathak/Work/office/ventana/github/librpmi/lib/rpmi_service_group_voltage.c:414:35: note: ‘volt_attrs.level_array’ was declared here
414 | struct rpmi_voltage_attrs volt_attrs;
| ^~~~~~~~~~
cc1: all warnings being treated as errors
make: *** [Makefile:196: /home/rpathak/Work/office/ventana/github/librpmi/build/lib/rpmi_service_group_voltage.o] Error 1
~/W/o/v/g/librpmi[2] 0.246s
~/W/o/v/g/librpmi[2] 0.246s

@pathakraul can you help try to add else statement for ./librpmi/lib/rpmi_service_group_voltage.c in the function '__rpmi_volt_get_attributes' will able to resolve the error above?

if (volt->vdata->discrete_range)
      attrs->level_array = volt->vdata->discrete_levels;
else if (volt->vdata->linear_range)
      attrs->level_array = volt->vdata->linear_levels;
+ else
+   return RPMI_ERR_FAILED;

@pathakraul
Copy link
Collaborator

You should update the PR with changes for the above fixes

@pathakraul
Copy link
Collaborator

looks like both of my toolchain does not generate the error mentioned above 1 of the toolchain is internal toolchain and another public toolchain

$ gcc --version gcc (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0 Copyright (C) 2023 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

This gcc version is too old

Joshua Yeong added 3 commits October 24, 2025 17:02
Implement Device Power Service Group.

Signed-off-by: Joshua Yeong <[email protected]>
Implement Performance Service Group.

Signed-off-by: Joshua Yeong <[email protected]>
Implement Performance Service Group.

Signed-off-by: Joshua Yeong <[email protected]>
@yeongjoshua
Copy link
Collaborator Author

@pathakraul i have update the commit verified with GCC 15.2.0

@pathakraul
Copy link
Collaborator

@yeongjoshua Other than 2 comments above, this looks good. Please also rebase your PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants