Skip to content

Conversation

@ceamac
Copy link
Contributor

@ceamac ceamac commented Nov 3, 2023

Compiling with gcc 13 and -O3 -flto found two possibly unitialized variables.

See also: https://bugs.gentoo.org/916722

/var/tmp/portage/app-misc/fastfetch-2.2.1/work/fastfetch-2.2.1/src/modules/wm/wm.c: In function 'ffGenerateWMJsonConfig':
/var/tmp/portage/app-misc/fastfetch-2.2.1/work/fastfetch-2.2.1/src/modules/wm/wm.c:103:48: error: 'defaultOptions.detectPlugin' is used uninitialized [-Werror=uninitialized]
  103 |     if (options->detectPlugin != defaultOptions.detectPlugin)
      |                                                ^
/var/tmp/portage/app-misc/fastfetch-2.2.1/work/fastfetch-2.2.1/src/modules/wm/wm.c:98:66: note: 'defaultOptions' declared here
   98 |     __attribute__((__cleanup__(ffDestroyWMOptions))) FFWMOptions defaultOptions;
      |                                                                  ^
/var/tmp/portage/app-misc/fastfetch-2.2.1/work/fastfetch-2.2.1/src/modules/cpuusage/cpuusage.c: In function 'ffGenerateCPUUsageJsonConfig':
/var/tmp/portage/app-misc/fastfetch-2.2.1/work/fastfetch-2.2.1/src/modules/cpuusage/cpuusage.c:138:44: error: 'defaultOptions.separate' is used uninitialized [-Werror=uninitialized]
  138 |     if (options->separate != defaultOptions.separate)
      |                                            ^
/var/tmp/portage/app-misc/fastfetch-2.2.1/work/fastfetch-2.2.1/src/modules/cpuusage/cpuusage.c:133:78: note: 'defaultOptions' declared here
  133 |     __attribute__((__cleanup__(ffDestroyCPUUsageOptions))) FFCPUUsageOptions defaultOptions;
      |                                                                              ^
lto1: some warnings being treated as errors

Compiling with gcc 13 and -O3 -flto -Werror=uninitialized found two
possibly unitialized variables.

See also: https://bugs.gentoo.org/916722
@CarterLi CarterLi merged commit 1c660ca into fastfetch-cli:dev Nov 3, 2023
@CarterLi
Copy link
Member

CarterLi commented Nov 3, 2023

Warning only reported with -O3? Weird...

Do you need me to cut a hotfix release?

@ceamac
Copy link
Contributor Author

ceamac commented Nov 3, 2023

Yeah, for some reason -O2 doesn't catch this.
And no, this doesn't look urgent, I think we can wait.

Thank you!

@CarterLi
Copy link
Member

CarterLi commented Nov 3, 2023

Okey. Let's wait one day or two. If no other bugs are found, I will cut a release.

@ceamac ceamac deleted the fix/bug-916722 branch November 3, 2023 15:49
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