Skip to content

Commit

Permalink
Silence gcc -Wmaybe-uninitialized warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
vspinu committed Apr 10, 2018
1 parent f3aa47d commit 6f222ba
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/tparse.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,9 @@ SEXP C_parse_dt(SEXP str, SEXP ord, SEXP formats, SEXP lt, SEXP cutoff_2000) {
int out_lt = *LOGICAL(lt);
int cut2000 = *INTEGER(cutoff_2000);

SEXP oYEAR, oMONTH, oDAY, oHOUR, oMIN, oSEC;
// initialize to avoid -Wmaybe-uninitialized gcc warnings
SEXP oYEAR = R_NilValue, oMONTH = R_NilValue, oDAY = R_NilValue,
oHOUR = R_NilValue, oMIN = R_NilValue, oSEC = R_NilValue;

if(out_lt){
oYEAR = PROTECT(allocVector(INTSXP, n));
Expand Down Expand Up @@ -288,7 +290,7 @@ SEXP C_parse_dt(SEXP str, SEXP ord, SEXP formats, SEXP lt, SEXP cutoff_2000) {
// If at least one subparser hasn't finished it's a failure.
if ( *c || *o ) succeed = 0;

int is_leap;
int is_leap = 0;

// adjust months for quarter
if (q > 1)
Expand Down

0 comments on commit 6f222ba

Please sign in to comment.