Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix compilation warnings #8

Open
Florents-Tselai opened this issue Dec 4, 2023 · 3 comments
Open

Fix compilation warnings #8

Florents-Tselai opened this issue Dec 4, 2023 · 3 comments

Comments

@Florents-Tselai
Copy link
Owner

They've been fine up until now, but with #6 they are - and should - be treated as errors

@Florents-Tselai
Copy link
Owner Author

src/mine.c:46:6: warning: no previous prototype for function 'quicksort' [-Wmissing-prototypes]
void quicksort(double *a, int *idx, int l, int u)
     ^
src/mine.c:46:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
void quicksort(double *a, int *idx, int l, int u)
^
static 
src/mine.c:84:6: warning: no previous prototype for function 'argsort' [-Wmissing-prototypes]
int *argsort(double *a, int n)
     ^
src/mine.c:84:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
int *argsort(double *a, int n)
^
static 
src/mine.c:125:8: warning: no previous prototype for function 'hq' [-Wmissing-prototypes]
double hq(int **cumhist, double **cumhist_log, int q, int p, int n)
       ^
src/mine.c:125:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
double hq(int **cumhist, double **cumhist_log, int q, int p, int n)
^
static 
src/mine.c:156:8: warning: no previous prototype for function 'hp3' [-Wmissing-prototypes]
double hp3(int *c, double *c_log, int s, int t)
       ^
src/mine.c:156:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
double hp3(int *c, double *c_log, int s, int t)
^
static 
src/mine.c:199:8: warning: no previous prototype for function 'hp3q' [-Wmissing-prototypes]
double hp3q(int **cumhist, double **cumhist_log, int *c, int q, int p, int s, int t)
       ^
src/mine.c:199:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
double hp3q(int **cumhist, double **cumhist_log, int *c, int q, int p, int s, int t)
^
static 
src/mine.c:243:8: warning: no previous prototype for function 'hp2q' [-Wmissing-prototypes]
double hp2q(int **cumhist, int *c, int q, int p, int s, int t)
       ^
src/mine.c:243:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
double hp2q(int **cumhist, int *c, int q, int p, int s, int t)
^
static 
src/mine.c:283:5: warning: no previous prototype for function 'EquipartitionYAxis' [-Wmissing-prototypes]
int EquipartitionYAxis(double *dy, int n, int y, int *Q_map, int *q)
    ^
src/mine.c:283:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
int EquipartitionYAxis(double *dy, int n, int y, int *Q_map, int *q)
^
static 
src/mine.c:343:5: warning: no previous prototype for function 'GetClumpsPartition' [-Wmissing-prototypes]
int GetClumpsPartition(double *dx, int n, int *Q_map, int *P_map, int *p)
    ^
src/mine.c:343:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
int GetClumpsPartition(double *dx, int n, int *Q_map, int *P_map, int *p)
^
static 
src/mine.c:414:5: warning: no previous prototype for function 'GetSuperclumpsPartition' [-Wmissing-prototypes]
int GetSuperclumpsPartition(double *dx, int n, int k_hat, int *Q_map,
    ^
src/mine.c:414:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
int GetSuperclumpsPartition(double *dx, int n, int k_hat, int *Q_map,
^
static 
src/mine.c:445:6: warning: no previous prototype for function 'compute_c' [-Wmissing-prototypes]
int *compute_c(int *P_map, int p, int n)
     ^
src/mine.c:445:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
int *compute_c(int *P_map, int p, int n)
^
static 
src/mine.c:468:9: warning: no previous prototype for function 'compute_c_log' [-Wmissing-prototypes]
double *compute_c_log(int *c, int p)
        ^
src/mine.c:468:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
double *compute_c_log(int *c, int p)
^
static 
src/mine.c:488:7: warning: no previous prototype for function 'compute_cumhist' [-Wmissing-prototypes]
int **compute_cumhist(int *Q_map, int q, int *P_map, int p, int n)
      ^
src/mine.c:488:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
int **compute_cumhist(int *Q_map, int q, int *P_map, int p, int n)
^
static 
src/mine.c:525:11: warning: no previous prototype for function 'compute_cumhist_log' [-Wmissing-prototypes]
double ** compute_cumhist_log(int **cumhist, int q, int p)
          ^
src/mine.c:525:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
double ** compute_cumhist_log(int **cumhist, int q, int p)
^
static 
src/mine.c:558:10: warning: no previous prototype for function 'init_I' [-Wmissing-prototypes]
double **init_I(int p, int x)
         ^
src/mine.c:558:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
double **init_I(int p, int x)
^
static 
src/mine.c:588:10: warning: no previous prototype for function 'compute_HP2Q' [-Wmissing-prototypes]
double **compute_HP2Q(int **cumhist, int*c, int q, int p)
         ^
src/mine.c:588:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
double **compute_HP2Q(int **cumhist, int*c, int q, int p)
^
static 
src/mine.c:637:5: warning: no previous prototype for function 'OptimizeXAxis' [-Wmissing-prototypes]
int OptimizeXAxis(double *dx, double *dy, int n, int *Q_map, int q,
    ^
src/mine.c:637:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
int OptimizeXAxis(double *dx, double *dy, int n, int *Q_map, int q,
^
static 
src/mine.c:784:13: warning: no previous prototype for function 'init_score' [-Wmissing-prototypes]
mine_score *init_score(mine_problem *prob, mine_parameter *param)
            ^
src/mine.c:784:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
mine_score *init_score(mine_problem *prob, mine_parameter *param)
^
static 
17 warnings generated.
src/vasco.c:228:15: warning: mixing declarations and code is incompatible with standards before C99 [-Wdeclaration-after-statement]
    TupleDesc resultTupleDesc;
              ^
src/vasco.c:264:11: warning: variable 'n' set but not used [-Wunused-but-set-variable]
    Datum n, x, y;
          ^

@Florents-Tselai Florents-Tselai changed the title Tackle compilation warnings Fix compilation warnings Dec 4, 2023
@Florents-Tselai
Copy link
Owner Author

Extracting headers for this, can help with #4 too.

@Florents-Tselai
Copy link
Owner Author

Also see #11

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

No branches or pull requests

1 participant