Skip to content

Commit

Permalink
Fix missing initializers warning on = {0}
Browse files Browse the repository at this point in the history
  • Loading branch information
ntrel committed Jan 9, 2012
1 parent 0755b44 commit fa3b07b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/project.c
Expand Up @@ -492,7 +492,9 @@ static void show_project_properties(gboolean show_build)
GeanyProject *p = app->project;
GtkWidget *widget = NULL;
GtkWidget *radio_long_line_custom;
static PropertyDialogElements e = { 0 };
static PropertyDialogElements e;

memset(&e, 0, sizeof(PropertyDialogElements));

g_return_if_fail(app->project != NULL);

Expand Down

2 comments on commit fa3b07b

@codebrainz
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Heh, weird, I thought I was using -Wall -Wextra but apperently not :) Thanks for catching.

Anyway, I even don't think the memset() is needed since static variables are guaranteed to be initialized to 0's (at least AFAIK).

Edit:
Actually, this memset() bypasses the check a few lines down to avoid calling create_properties_dialog() more than once, not that it's a big deal.

@ntrel
Copy link
Member Author

@ntrel ntrel commented on fa3b07b Jan 9, 2012

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, yes I messed that up. I'll remove the memset now if we can rely on static zeroing.

Please sign in to comment.