Menu

#535 [lxtask] fix multiple definitions of global variables (builds with -fno-common)

-
open-accepted
lxtask (8)
5
2020-10-27
2016-09-13
Hanno Böck
No

In lxtask there are a couple of global variables defined in headers that get included multiple times. gcc traditionally ignores such issues and allows multiple definitions, however it's not correct C code. One can get gcc to behave more strictly with the parameter -fno-common.

The attached patch fixes all multiple definitions. Two variables - custom_signal_0 and custom_signal_1 - don't seem to be used at all, so I removed them. Several variables in interface.h need to be made external, the main variable definition got moved to interface.c.

1 Attachments

Discussion

  • Mamoru TASAKA

    Mamoru TASAKA - 2020-01-24

    gcc10 now defaults to -fno-common :
    https://gcc.gnu.org/gcc-10/changes.html

    So without this patch, lxtask fails to compile with gcc10. Please review and consider to apply this.

     
  • Lonely Stranger

    Lonely Stranger - 2020-10-27
    • labels: --> lxtask
    • status: open --> open-accepted
    • assigned_to: Lonely Stranger
     
  • Lonely Stranger

    Lonely Stranger - 2020-10-27

    Thank you very much for your fix. That's sad it left unnoticed for so long time.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.