Ticket #161 (closed defect: fixed)

Opened 14 months ago

Last modified 13 months ago

Patch: Don't initialize variables in header files

Reported by: markdoliner Owned by: smoku
Priority: major Component: Build
Version: 2.1.17 Keywords:
Cc: Tracforge_linkmap:
Blocking: Blocked By:

Description

The _stanza_errors array is initialized in util/util.h, however, this causes a large number of these warnings in various files:

storage.c: At top level: ../util/util.h:379: warning: ‘_stanza_errors’ defined but not used

I think the correct way to handle this is to declare the variable as extern in the header file, and then to initialize the variable in a source file.

I'm using gcc 4.1.2 with CFLAGS="-ggdb -Wall -Wdeclaration-after-statement -Werror-implicit-function-declaration"

Attachments

Change History

Changed 14 months ago by markdoliner

Changed 13 months ago by smoku

  • status changed from new to closed
  • resolution set to fixed

(In [430]) Don't initialize variables in header files. Fixes #161

Note: See TracTickets for help on using tickets.