micromegas 6.0.3 installation problem

Asked by Partha Kumar Paul

I am trying to install micromegas 6.0.3. When I am doing make, I am getting the following error,

polint.c:98:1: warning: non-void function does not return a value [-Wreturn-type]
}
^
1 warning generated.
ar rv /Users/partha/iith/researchsoftwares/micromegas/micromegas_6.0.3/CalcHEP_src/lib/ntools.a polint.o
a - polint.o
clang -g -fsigned-char -std=gnu99 -fPIC -Iinclude -I../../include -I../chep_crt/include -I../plot/include -I../service2/include -I../getmem/include -I../dynamicME/include -I../SLHAplus/include -I../num/include -c -o vegas.o vegas.c
ar rv /Users/partha/iith/researchsoftwares/micromegas/micromegas_6.0.3/CalcHEP_src/lib/ntools.a vegas.o
a - vegas.o
ranlib -c /Users/partha/iith/researchsoftwares/micromegas/micromegas_6.0.3/CalcHEP_src/lib/ntools.a
/Applications/Xcode.app/Contents/Developer/usr/bin/make -C dynamicME
clang -g -fsigned-char -std=gnu99 -fPIC -Iinclude -I../SLHAplus/include -I../service2/include -I../chep_crt/include -I../../include -I../ntools/include -DMAKE=\"/Applications/Xcode.app/Contents/Developer/usr/bin/make\" -c -o dynamic_cs.o dynamic_cs.c
dynamic_cs.c:290:35: warning: for loop has empty body [-Wempty-body]
      for(i=0;Process[i]==' ';i++); if(Process[i]==0)
                                  ^
dynamic_cs.c:290:35: note: put the semicolon on a separate line to silence this warning
dynamic_cs.c:512:32: warning: incompatible pointer types passing 'char *[10]' to parameter of type 'char *' [-Wincompatible-pointer-types]
     if(i==j){ nnew++; sprintf(alias[i],"#_%d",nnew);} else alias[i][0]=0;
                               ^~~~~~~~
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/secure/_stdio.h:47:28: note: expanded from macro 'sprintf'
  __builtin___sprintf_chk (str, 0, __darwin_obsz(str), __VA_ARGS__)
                           ^~~
dynamic_cs.c:518:18: warning: incompatible pointer types passing 'char *[10]' to parameter of type 'const char *' [-Wincompatible-pointer-types]
  strcpy(process,alias[0]);
                 ^~~~~~~~
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/secure/_string.h:84:33: note: expanded from macro 'strcpy'
                __builtin___strcpy_chk (dest, __VA_ARGS__, __darwin_obsz (dest))
                                              ^~~~~~~~~~~
dynamic_cs.c:523:46: warning: format specifies type 'char *' but the argument has type 'char **' [-Wformat]
     { sprintf(process+strlen(process),"%s", alias[j]); break;}
                                        ~~ ^~~~~~~~
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/secure/_stdio.h:47:56: note: expanded from macro 'sprintf'
  __builtin___sprintf_chk (str, 0, __darwin_obsz(str), __VA_ARGS__)
                                                       ^~~~~~~~~~~
4 warnings generated.
ar rv ../../lib/dynamic_me.a dynamic_cs.o
ar: creating archive ../../lib/dynamic_me.a
a - dynamic_cs.o
clang -g -fsigned-char -std=gnu99 -fPIC -Iinclude -I../SLHAplus/include -I../service2/include -I../chep_crt/include -I../../include -I../ntools/include -DMAKE=\"/Applications/Xcode.app/Contents/Developer/usr/bin/make\" -c -o kin4.o kin4.c
kin4.c:84:34: error: incompatible function pointer types passing 'double (double, sVarW *)' to parameter of type 'double (*)(double, void *)' [-Wincompatible-function-pointer-types]
   if(n_Gauss) return gauss_arg(intDecay2_,sVar,0,1,n_Gauss);
                                 ^~~~~~~~~~
./../ntools/include/1d_integration.h:6:35: note: passing argument to parameter 'func' here
extern double gauss_arg( double (*func)(double,void*par),void*par,double a,double b, int n);
                                  ^
kin4.c:85:35: error: incompatible function pointer types passing 'double (double, sVarW *)' to parameter of type 'double (*)(double, void *)' [-Wincompatible-function-pointer-types]
   else return simpson_arg(intDecay2_,sVar,0,1,1.E-5,NULL);
                                  ^~~~~~~~~~
./../ntools/include/1d_integration.h:10:37: note: passing argument to parameter 'func' here
extern double simpson_arg( double (*func)(double,void*par), void*par,double a,double b,double eps, int*err);
                                    ^
kin4.c:115:35: error: incompatible function pointer types passing 'double (double, sVarW *)' to parameter of type 'double (*)(double, void *)' [-Wincompatible-function-pointer-types]
    if(n_Gauss) return gauss_arg( intDecay2_,sVar,0,1,n_Gauss)/M_PI/ME(m0,m1,m2);
                                  ^~~~~~~~~~
./../ntools/include/1d_integration.h:6:35: note: passing argument to parameter 'func' here
extern double gauss_arg( double (*func)(double,void*par),void*par,double a,double b, int n);
                                  ^
kin4.c:116:36: error: incompatible function pointer types passing 'double (double, sVarW *)' to parameter of type 'double (*)(double, void *)' [-Wincompatible-function-pointer-types]
     else return simpson_arg( intDecay2_,sVar,0,1,1.E-3,NULL)/M_PI/ME(m0,m1,m2);
                                   ^~~~~~~~~~
./../ntools/include/1d_integration.h:10:37: note: passing argument to parameter 'func' here
extern double simpson_arg( double (*func)(double,void*par), void*par,double a,double b,double eps, int*err);
                                    ^
kin4.c:125:35: error: incompatible function pointer types passing 'double (double, sVarW *)' to parameter of type 'double (*)(double, void *)' [-Wincompatible-function-pointer-types]
    if(n_Gauss) return gauss_arg( intDecay2_,sVar,0,1,n_Gauss)/M_PI/ME(m0,m1,m2);
                                  ^~~~~~~~~~
./../ntools/include/1d_integration.h:6:35: note: passing argument to parameter 'func' here
extern double gauss_arg( double (*func)(double,void*par),void*par,double a,double b, int n);
                                  ^
kin4.c:126:35: error: incompatible function pointer types passing 'double (double, sVarW *)' to parameter of type 'double (*)(double, void *)' [-Wincompatible-function-pointer-types]
    else return simpson_arg(intDecay2_,sVar,0,1,1.E-3,NULL)/M_PI/ME(m0,m1,m2);
                                  ^~~~~~~~~~
./../ntools/include/1d_integration.h:10:37: note: passing argument to parameter 'func' here
extern double simpson_arg( double (*func)(double,void*par), void*par,double a,double b,double eps, int*err);
                                    ^
kin4.c:156:24: error: incompatible function pointer types passing 'double (double, sVarW *)' to parameter of type 'double (*)(double, void *)' [-Wincompatible-function-pointer-types]
double res=simpson_arg(intDecay1_,sVar,0,1,1E-5,NULL);
                       ^~~~~~~~~~
./../ntools/include/1d_integration.h:10:37: note: passing argument to parameter 'func' here
extern double simpson_arg( double (*func)(double,void*par), void*par,double a,double b,double eps, int*err);
                                    ^
kin4.c:693:6: warning: using floating point absolute value function 'fabs' when argument is of integer type [-Wabsolute-value]
  if(fabs(pdg2)<=2 && m2<0.14) m2=0.14;
     ^
kin4.c:693:6: note: use function 'abs' instead
  if(fabs(pdg2)<=2 && m2<0.14) m2=0.14;
     ^~~~
     abs
kin4.c:694:6: warning: using floating point absolute value function 'fabs' when argument is of integer type [-Wabsolute-value]
  if(fabs(pdg3)<=2 && m3<0.14) m3=0.14;
     ^
kin4.c:694:6: note: use function 'abs' instead
  if(fabs(pdg3)<=2 && m3<0.14) m3=0.14;
     ^~~~
     abs
kin4.c:695:6: warning: using floating point absolute value function 'fabs' when argument is of integer type [-Wabsolute-value]
  if(fabs(pdg3)==3 && m2<0.5) m2=0.5;
     ^
kin4.c:695:6: note: use function 'abs' instead
  if(fabs(pdg3)==3 && m2<0.5) m2=0.5;
     ^~~~
     abs
kin4.c:696:6: warning: using floating point absolute value function 'fabs' when argument is of integer type [-Wabsolute-value]
  if(fabs(pdg3)==32 && m3<0.5) m3=0.5;
     ^
kin4.c:696:6: note: use function 'abs' instead
  if(fabs(pdg3)==32 && m3<0.5) m3=0.5;
     ^~~~
     abs
kin4.c:756:53: warning: add explicit braces to avoid dangling else [-Wdangling-else]
   for(j=1;j<3;j++) if(pdg[j]==23 && VZdecay) s-=6; else if(abs(pdg[j])==24 && VWdecay) s-=5;
                                                    ^
5 warnings and 7 errors generated.
make[3]: *** [kin4.o] Error 1
rm dynamic_cs.o
make[2]: *** [all] Error 2
make[1]: *** [COMPILE] Error 2
make: *** [all] Error 2

System: MBP M3.

However, I faced no issues with my Ubuntu system.
Any help will be really appreciated.

Question information

Language:
English Edit question
Status:
Solved
For:
CalcHEP Edit question
Assignee:
No assignee Edit question
Solved by:
Alexander Pukhov
Solved:
Last query:
Last reply:
Revision history for this message
Alexander Pukhov (pukhov) said :
#1

The problem is  caused by new  clang compiler.  Some non-accurate
written codes  which leaded to warnings now lead to error.

The last micromegas version in 6.0.5.

I hope all errors mentioned in your mail are fixed in  6.0.5. Indeed
one  new  warning=>bug modification in clang appears after appearance of
6.0.5.

  Let me know if you  have a problem with 6.0.5

Best

     Alexander Pukhov

On 5/27/24 08:30, PARTHA KUMAR PAUL wrote:
> New question #816097 on CalcHEP:
> https://answers.launchpad.net/calchep/+question/816097
>
> I am trying to install micromegas 6.0.3. When I am doing make, I am getting the following error,
>
>
>
> polint.c:98:1: warning: non-void function does not return a value [-Wreturn-type]
> }
> ^
> 1 warning generated.
> ar rv /Users/partha/iith/researchsoftwares/micromegas/micromegas_6.0.3/CalcHEP_src/lib/ntools.a polint.o
> a - polint.o
> clang -g -fsigned-char -std=gnu99 -fPIC -Iinclude -I../../include -I../chep_crt/include -I../plot/include -I../service2/include -I../getmem/include -I../dynamicME/include -I../SLHAplus/include -I../num/include -c -o vegas.o vegas.c
> ar rv /Users/partha/iith/researchsoftwares/micromegas/micromegas_6.0.3/CalcHEP_src/lib/ntools.a vegas.o
> a - vegas.o
> ranlib -c /Users/partha/iith/researchsoftwares/micromegas/micromegas_6.0.3/CalcHEP_src/lib/ntools.a
> /Applications/Xcode.app/Contents/Developer/usr/bin/make -C dynamicME
> clang -g -fsigned-char -std=gnu99 -fPIC -Iinclude -I../SLHAplus/include -I../service2/include -I../chep_crt/include -I../../include -I../ntools/include -DMAKE=\"/Applications/Xcode.app/Contents/Developer/usr/bin/make\" -c -o dynamic_cs.o dynamic_cs.c
> dynamic_cs.c:290:35: warning: for loop has empty body [-Wempty-body]
> for(i=0;Process[i]==' ';i++); if(Process[i]==0)
> ^
> dynamic_cs.c:290:35: note: put the semicolon on a separate line to silence this warning
> dynamic_cs.c:512:32: warning: incompatible pointer types passing 'char *[10]' to parameter of type 'char *' [-Wincompatible-pointer-types]
> if(i==j){ nnew++; sprintf(alias[i],"#_%d",nnew);} else alias[i][0]=0;
> ^~~~~~~~
> /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/secure/_stdio.h:47:28: note: expanded from macro 'sprintf'
> __builtin___sprintf_chk (str, 0, __darwin_obsz(str), __VA_ARGS__)
> ^~~
> dynamic_cs.c:518:18: warning: incompatible pointer types passing 'char *[10]' to parameter of type 'const char *' [-Wincompatible-pointer-types]
> strcpy(process,alias[0]);
> ^~~~~~~~
> /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/secure/_string.h:84:33: note: expanded from macro 'strcpy'
> __builtin___strcpy_chk (dest, __VA_ARGS__, __darwin_obsz (dest))
> ^~~~~~~~~~~
> dynamic_cs.c:523:46: warning: format specifies type 'char *' but the argument has type 'char **' [-Wformat]
> { sprintf(process+strlen(process),"%s", alias[j]); break;}
> ~~ ^~~~~~~~
> /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/secure/_stdio.h:47:56: note: expanded from macro 'sprintf'
> __builtin___sprintf_chk (str, 0, __darwin_obsz(str), __VA_ARGS__)
> ^~~~~~~~~~~
> 4 warnings generated.
> ar rv ../../lib/dynamic_me.a dynamic_cs.o
> ar: creating archive ../../lib/dynamic_me.a
> a - dynamic_cs.o
> clang -g -fsigned-char -std=gnu99 -fPIC -Iinclude -I../SLHAplus/include -I../service2/include -I../chep_crt/include -I../../include -I../ntools/include -DMAKE=\"/Applications/Xcode.app/Contents/Developer/usr/bin/make\" -c -o kin4.o kin4.c
> kin4.c:84:34: error: incompatible function pointer types passing 'double (double, sVarW *)' to parameter of type 'double (*)(double, void *)' [-Wincompatible-function-pointer-types]
> if(n_Gauss) return gauss_arg(intDecay2_,sVar,0,1,n_Gauss);
> ^~~~~~~~~~
> ./../ntools/include/1d_integration.h:6:35: note: passing argument to parameter 'func' here
> extern double gauss_arg( double (*func)(double,void*par),void*par,double a,double b, int n);
> ^
> kin4.c:85:35: error: incompatible function pointer types passing 'double (double, sVarW *)' to parameter of type 'double (*)(double, void *)' [-Wincompatible-function-pointer-types]
> else return simpson_arg(intDecay2_,sVar,0,1,1.E-5,NULL);
> ^~~~~~~~~~
> ./../ntools/include/1d_integration.h:10:37: note: passing argument to parameter 'func' here
> extern double simpson_arg( double (*func)(double,void*par), void*par,double a,double b,double eps, int*err);
> ^
> kin4.c:115:35: error: incompatible function pointer types passing 'double (double, sVarW *)' to parameter of type 'double (*)(double, void *)' [-Wincompatible-function-pointer-types]
> if(n_Gauss) return gauss_arg( intDecay2_,sVar,0,1,n_Gauss)/M_PI/ME(m0,m1,m2);
> ^~~~~~~~~~
> ./../ntools/include/1d_integration.h:6:35: note: passing argument to parameter 'func' here
> extern double gauss_arg( double (*func)(double,void*par),void*par,double a,double b, int n);
> ^
> kin4.c:116:36: error: incompatible function pointer types passing 'double (double, sVarW *)' to parameter of type 'double (*)(double, void *)' [-Wincompatible-function-pointer-types]
> else return simpson_arg( intDecay2_,sVar,0,1,1.E-3,NULL)/M_PI/ME(m0,m1,m2);
> ^~~~~~~~~~
> ./../ntools/include/1d_integration.h:10:37: note: passing argument to parameter 'func' here
> extern double simpson_arg( double (*func)(double,void*par), void*par,double a,double b,double eps, int*err);
> ^
> kin4.c:125:35: error: incompatible function pointer types passing 'double (double, sVarW *)' to parameter of type 'double (*)(double, void *)' [-Wincompatible-function-pointer-types]
> if(n_Gauss) return gauss_arg( intDecay2_,sVar,0,1,n_Gauss)/M_PI/ME(m0,m1,m2);
> ^~~~~~~~~~
> ./../ntools/include/1d_integration.h:6:35: note: passing argument to parameter 'func' here
> extern double gauss_arg( double (*func)(double,void*par),void*par,double a,double b, int n);
> ^
> kin4.c:126:35: error: incompatible function pointer types passing 'double (double, sVarW *)' to parameter of type 'double (*)(double, void *)' [-Wincompatible-function-pointer-types]
> else return simpson_arg(intDecay2_,sVar,0,1,1.E-3,NULL)/M_PI/ME(m0,m1,m2);
> ^~~~~~~~~~
> ./../ntools/include/1d_integration.h:10:37: note: passing argument to parameter 'func' here
> extern double simpson_arg( double (*func)(double,void*par), void*par,double a,double b,double eps, int*err);
> ^
> kin4.c:156:24: error: incompatible function pointer types passing 'double (double, sVarW *)' to parameter of type 'double (*)(double, void *)' [-Wincompatible-function-pointer-types]
> double res=simpson_arg(intDecay1_,sVar,0,1,1E-5,NULL);
> ^~~~~~~~~~
> ./../ntools/include/1d_integration.h:10:37: note: passing argument to parameter 'func' here
> extern double simpson_arg( double (*func)(double,void*par), void*par,double a,double b,double eps, int*err);
> ^
> kin4.c:693:6: warning: using floating point absolute value function 'fabs' when argument is of integer type [-Wabsolute-value]
> if(fabs(pdg2)<=2 && m2<0.14) m2=0.14;
> ^
> kin4.c:693:6: note: use function 'abs' instead
> if(fabs(pdg2)<=2 && m2<0.14) m2=0.14;
> ^~~~
> abs
> kin4.c:694:6: warning: using floating point absolute value function 'fabs' when argument is of integer type [-Wabsolute-value]
> if(fabs(pdg3)<=2 && m3<0.14) m3=0.14;
> ^
> kin4.c:694:6: note: use function 'abs' instead
> if(fabs(pdg3)<=2 && m3<0.14) m3=0.14;
> ^~~~
> abs
> kin4.c:695:6: warning: using floating point absolute value function 'fabs' when argument is of integer type [-Wabsolute-value]
> if(fabs(pdg3)==3 && m2<0.5) m2=0.5;
> ^
> kin4.c:695:6: note: use function 'abs' instead
> if(fabs(pdg3)==3 && m2<0.5) m2=0.5;
> ^~~~
> abs
> kin4.c:696:6: warning: using floating point absolute value function 'fabs' when argument is of integer type [-Wabsolute-value]
> if(fabs(pdg3)==32 && m3<0.5) m3=0.5;
> ^
> kin4.c:696:6: note: use function 'abs' instead
> if(fabs(pdg3)==32 && m3<0.5) m3=0.5;
> ^~~~
> abs
> kin4.c:756:53: warning: add explicit braces to avoid dangling else [-Wdangling-else]
> for(j=1;j<3;j++) if(pdg[j]==23 && VZdecay) s-=6; else if(abs(pdg[j])==24 && VWdecay) s-=5;
> ^
> 5 warnings and 7 errors generated.
> make[3]: *** [kin4.o] Error 1
> rm dynamic_cs.o
> make[2]: *** [all] Error 2
> make[1]: *** [COMPILE] Error 2
> make: *** [all] Error 2
>
>
> System: MBP M3.
>
> However, I faced no issues with my Ubuntu system.
> Any help will be really appreciated.
>

Revision history for this message
Partha Kumar Paul (parthakumarpaul) said :
#2

This is the error with 6.0.5

clang -g -fsigned-char -std=gnu99 -fPIC -Iinclude -I../chep_crt/include -I../getmem/include -I../service2/include -I../symb/include -DNUM_DOUBLE -c -o symb_tot.o symb_tot.c
symb_tot.c:398:1: warning: non-void function does not return a value in all control paths [-Wreturn-type]
}
^
symb_tot.c:443:1: warning: non-void function does not return a value in all control paths [-Wreturn-type]
}
^
2 warnings generated.
ar rv ../../lib/symb.a symb_tot.o
a - symb_tot.o
clang -g -fsigned-char -std=gnu99 -fPIC -Iinclude -I../chep_crt/include -I../getmem/include -I../service2/include -I../symb/include -DNUM_DOUBLE -c -o symb_wrt.o symb_wrt.c
ar rv ../../lib/symb.a symb_wrt.o
a - symb_wrt.o
clang -g -fsigned-char -std=gnu99 -fPIC -Iinclude -I../chep_crt/include -I../getmem/include -I../service2/include -I../symb/include -DNUM_DOUBLE -c -o tensor.o tensor.c
ar rv ../../lib/symb.a tensor.o
a - tensor.o
ranlib -c ../../lib/symb.a
/Applications/Xcode.app/Contents/Developer/usr/bin/make -C ntools
clang -g -fsigned-char -std=gnu99 -fPIC -Iinclude -I../../include -I../chep_crt/include -I../plot/include -I../service2/include -I../getmem/include -I../dynamicME/include -I../SLHAplus/include -I../num/include -c -o 1d_integration.o 1d_integration.c
ar rv /Users/partha/iith/researchsoftwares/micromegas/check/micromegas_6.0.5/CalcHEP_src/lib/ntools.a 1d_integration.o
ar: creating archive /Users/partha/iith/researchsoftwares/micromegas/check/micromegas_6.0.5/CalcHEP_src/lib/ntools.a
a - 1d_integration.o
clang -g -fsigned-char -std=gnu99 -fPIC -Iinclude -I../../include -I../chep_crt/include -I../plot/include -I../service2/include -I../getmem/include -I../dynamicME/include -I../SLHAplus/include -I../num/include -c -o drandXX.o drandXX.c
ar rv /Users/partha/iith/researchsoftwares/micromegas/check/micromegas_6.0.5/CalcHEP_src/lib/ntools.a drandXX.o
a - drandXX.o
clang -g -fsigned-char -std=gnu99 -fPIC -Iinclude -I../../include -I../chep_crt/include -I../plot/include -I../service2/include -I../getmem/include -I../dynamicME/include -I../SLHAplus/include -I../num/include -c -o n_proc.o n_proc.c
ar rv /Users/partha/iith/researchsoftwares/micromegas/check/micromegas_6.0.5/CalcHEP_src/lib/ntools.a n_proc.o
a - n_proc.o
clang -g -fsigned-char -std=gnu99 -fPIC -Iinclude -I../../include -I../chep_crt/include -I../plot/include -I../service2/include -I../getmem/include -I../dynamicME/include -I../SLHAplus/include -I../num/include -c -o polint.o polint.c
polint.c:98:1: warning: non-void function does not return a value [-Wreturn-type]
}
^
1 warning generated.
ar rv /Users/partha/iith/researchsoftwares/micromegas/check/micromegas_6.0.5/CalcHEP_src/lib/ntools.a polint.o
a - polint.o
clang -g -fsigned-char -std=gnu99 -fPIC -Iinclude -I../../include -I../chep_crt/include -I../plot/include -I../service2/include -I../getmem/include -I../dynamicME/include -I../SLHAplus/include -I../num/include -c -o vegas.o vegas.c
ar rv /Users/partha/iith/researchsoftwares/micromegas/check/micromegas_6.0.5/CalcHEP_src/lib/ntools.a vegas.o
a - vegas.o
ranlib -c /Users/partha/iith/researchsoftwares/micromegas/check/micromegas_6.0.5/CalcHEP_src/lib/ntools.a
/Applications/Xcode.app/Contents/Developer/usr/bin/make -C dynamicME
clang -g -fsigned-char -std=gnu99 -fPIC -Iinclude -I../SLHAplus/include -I../service2/include -I../chep_crt/include -I../../include -I../ntools/include -DMAKE=\"/Applications/Xcode.app/Contents/Developer/usr/bin/make\" -c -o dynamic_cs.o dynamic_cs.c
dynamic_cs.c:290:35: warning: for loop has empty body [-Wempty-body]
      for(i=0;Process[i]==' ';i++); if(Process[i]==0)
                                  ^
dynamic_cs.c:290:35: note: put the semicolon on a separate line to silence this warning
dynamic_cs.c:512:32: warning: incompatible pointer types passing 'char *[10]' to parameter of type 'char *' [-Wincompatible-pointer-types]
     if(i==j){ nnew++; sprintf(alias[i],"#_%d",nnew);} else alias[i][0]=0;
                               ^~~~~~~~
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/secure/_stdio.h:47:28: note: expanded from macro 'sprintf'
  __builtin___sprintf_chk (str, 0, __darwin_obsz(str), __VA_ARGS__)
                           ^~~
dynamic_cs.c:518:18: warning: incompatible pointer types passing 'char *[10]' to parameter of type 'const char *' [-Wincompatible-pointer-types]
  strcpy(process,alias[0]);
                 ^~~~~~~~
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/secure/_string.h:84:33: note: expanded from macro 'strcpy'
                __builtin___strcpy_chk (dest, __VA_ARGS__, __darwin_obsz (dest))
                                              ^~~~~~~~~~~
dynamic_cs.c:523:46: warning: format specifies type 'char *' but the argument has type 'char **' [-Wformat]
     { sprintf(process+strlen(process),"%s", alias[j]); break;}
                                        ~~ ^~~~~~~~
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/secure/_stdio.h:47:56: note: expanded from macro 'sprintf'
  __builtin___sprintf_chk (str, 0, __darwin_obsz(str), __VA_ARGS__)
                                                       ^~~~~~~~~~~
4 warnings generated.
ar rv ../../lib/dynamic_me.a dynamic_cs.o
ar: creating archive ../../lib/dynamic_me.a
a - dynamic_cs.o
clang -g -fsigned-char -std=gnu99 -fPIC -Iinclude -I../SLHAplus/include -I../service2/include -I../chep_crt/include -I../../include -I../ntools/include -DMAKE=\"/Applications/Xcode.app/Contents/Developer/usr/bin/make\" -c -o kin4.o kin4.c
kin4.c:84:34: error: incompatible function pointer types passing 'double (double, sVarW *)' to parameter of type 'double (*)(double, void *)' [-Wincompatible-function-pointer-types]
   if(n_Gauss) return gauss_arg(intDecay2_,sVar,0,1,n_Gauss);
                                 ^~~~~~~~~~
./../ntools/include/1d_integration.h:6:35: note: passing argument to parameter 'func' here
extern double gauss_arg( double (*func)(double,void*par),void*par,double a,double b, int n);
                                  ^
kin4.c:85:35: error: incompatible function pointer types passing 'double (double, sVarW *)' to parameter of type 'double (*)(double, void *)' [-Wincompatible-function-pointer-types]
   else return simpson_arg(intDecay2_,sVar,0,1,1.E-5,NULL);
                                  ^~~~~~~~~~
./../ntools/include/1d_integration.h:10:37: note: passing argument to parameter 'func' here
extern double simpson_arg( double (*func)(double,void*par), void*par,double a,double b,double eps, int*err);
                                    ^
kin4.c:115:35: error: incompatible function pointer types passing 'double (double, sVarW *)' to parameter of type 'double (*)(double, void *)' [-Wincompatible-function-pointer-types]
    if(n_Gauss) return gauss_arg( intDecay2_,sVar,0,1,n_Gauss)/M_PI/ME(m0,m1,m2);
                                  ^~~~~~~~~~
./../ntools/include/1d_integration.h:6:35: note: passing argument to parameter 'func' here
extern double gauss_arg( double (*func)(double,void*par),void*par,double a,double b, int n);
                                  ^
kin4.c:116:36: error: incompatible function pointer types passing 'double (double, sVarW *)' to parameter of type 'double (*)(double, void *)' [-Wincompatible-function-pointer-types]
     else return simpson_arg( intDecay2_,sVar,0,1,1.E-3,NULL)/M_PI/ME(m0,m1,m2);
                                   ^~~~~~~~~~
./../ntools/include/1d_integration.h:10:37: note: passing argument to parameter 'func' here
extern double simpson_arg( double (*func)(double,void*par), void*par,double a,double b,double eps, int*err);
                                    ^
kin4.c:125:35: error: incompatible function pointer types passing 'double (double, sVarW *)' to parameter of type 'double (*)(double, void *)' [-Wincompatible-function-pointer-types]
    if(n_Gauss) return gauss_arg( intDecay2_,sVar,0,1,n_Gauss)/M_PI/ME(m0,m1,m2);
                                  ^~~~~~~~~~
./../ntools/include/1d_integration.h:6:35: note: passing argument to parameter 'func' here
extern double gauss_arg( double (*func)(double,void*par),void*par,double a,double b, int n);
                                  ^
kin4.c:126:35: error: incompatible function pointer types passing 'double (double, sVarW *)' to parameter of type 'double (*)(double, void *)' [-Wincompatible-function-pointer-types]
    else return simpson_arg(intDecay2_,sVar,0,1,1.E-3,NULL)/M_PI/ME(m0,m1,m2);
                                  ^~~~~~~~~~
./../ntools/include/1d_integration.h:10:37: note: passing argument to parameter 'func' here
extern double simpson_arg( double (*func)(double,void*par), void*par,double a,double b,double eps, int*err);
                                    ^
kin4.c:156:24: error: incompatible function pointer types passing 'double (double, sVarW *)' to parameter of type 'double (*)(double, void *)' [-Wincompatible-function-pointer-types]
double res=simpson_arg(intDecay1_,sVar,0,1,1E-5,NULL);
                       ^~~~~~~~~~
./../ntools/include/1d_integration.h:10:37: note: passing argument to parameter 'func' here
extern double simpson_arg( double (*func)(double,void*par), void*par,double a,double b,double eps, int*err);
                                    ^
kin4.c:693:6: warning: using floating point absolute value function 'fabs' when argument is of integer type [-Wabsolute-value]
  if(fabs(pdg2)<=2 && m2<0.14) m2=0.14;
     ^
kin4.c:693:6: note: use function 'abs' instead
  if(fabs(pdg2)<=2 && m2<0.14) m2=0.14;
     ^~~~
     abs
kin4.c:694:6: warning: using floating point absolute value function 'fabs' when argument is of integer type [-Wabsolute-value]
  if(fabs(pdg3)<=2 && m3<0.14) m3=0.14;
     ^
kin4.c:694:6: note: use function 'abs' instead
  if(fabs(pdg3)<=2 && m3<0.14) m3=0.14;
     ^~~~
     abs
kin4.c:695:6: warning: using floating point absolute value function 'fabs' when argument is of integer type [-Wabsolute-value]
  if(fabs(pdg3)==3 && m2<0.5) m2=0.5;
     ^
kin4.c:695:6: note: use function 'abs' instead
  if(fabs(pdg3)==3 && m2<0.5) m2=0.5;
     ^~~~
     abs
kin4.c:696:6: warning: using floating point absolute value function 'fabs' when argument is of integer type [-Wabsolute-value]
  if(fabs(pdg3)==32 && m3<0.5) m3=0.5;
     ^
kin4.c:696:6: note: use function 'abs' instead
  if(fabs(pdg3)==32 && m3<0.5) m3=0.5;
     ^~~~
     abs
kin4.c:756:53: warning: add explicit braces to avoid dangling else [-Wdangling-else]
   for(j=1;j<3;j++) if(pdg[j]==23 && VZdecay) s-=6; else if(abs(pdg[j])==24 && VWdecay) s-=5;
                                                    ^
5 warnings and 7 errors generated.
make[3]: *** [kin4.o] Error 1
rm dynamic_cs.o
make[2]: *** [all] Error 2
make[1]: *** [COMPILE] Error 2
make: *** [all] Error 2

Revision history for this message
Best Alexander Pukhov (pukhov) said :
#3

Thank you for your mail.

clang -g -fsigned-char -std=gnu99 -fPIC -Iinclude -I../SLHAplus/include -I../service2/include -I../chep_crt/include -I../../include -I../ntools/include -DMAKE=\"/Applications/Xcode.app/Contents/Developer/usr/bin/make\" -c -o kin4.o kin4.c
kin4.c:84:34: error: incompatible function pointer types passing 'double (double, sVarW *)' to parameter of type 'double (*)(double, void *)'*[-Wincompatible-function-pointer-types]*
   *if(n_Gauss) return gauss_arg(intDecay2_,sVar,0,1,n_Gauss);*
                                  ^~~~~~~~~~
./../ntools/include/1d_integration.h:6:35: note: passing argument to parameter 'func' here
extern double gauss_arg( double (*func)(double,void*par),void*par,double a,double b, int n);

Here indeed function gauss_arg integrates function which has an external pointer-like parameter, but it point out on object of unexpected type.
In Linux compilers and old versions clang it leads to warning, but in last version of clang we get an error. In micromegas_6.0.5 we solve this problem with a special flag of compilation
            -Wno-error=incompatible-function-pointer-types
which forces compiler to treats the error message as a warning. We have success in this way for clang, but in the listing presented by you this flag is absent.

So, tell me, please, does your compiler allow this flag?

Best
     Alexander Pukhov

On 5/28/24 07:05, PARTHA KUMAR PAUL wrote:
> Question #816097 on CalcHEP changed:
> https://answers.launchpad.net/calchep/+question/816097
>
> PARTHA KUMAR PAUL posted a new comment:
> This is the error with 6.0.5
>
>
> clang -g -fsigned-char -std=gnu99 -fPIC -Iinclude -I../chep_crt/include -I../getmem/include -I../service2/include -I../symb/include -DNUM_DOUBLE -c -o symb_tot.o symb_tot.c
> symb_tot.c:398:1: warning: non-void function does not return a value in all control paths [-Wreturn-type]
> }
> ^
> symb_tot.c:443:1: warning: non-void function does not return a value in all control paths [-Wreturn-type]
> }
> ^
> 2 warnings generated.
> ar rv ../../lib/symb.a symb_tot.o
> a - symb_tot.o
> clang -g -fsigned-char -std=gnu99 -fPIC -Iinclude -I../chep_crt/include -I../getmem/include -I../service2/include -I../symb/include -DNUM_DOUBLE -c -o symb_wrt.o symb_wrt.c
> ar rv ../../lib/symb.a symb_wrt.o
> a - symb_wrt.o
> clang -g -fsigned-char -std=gnu99 -fPIC -Iinclude -I../chep_crt/include -I../getmem/include -I../service2/include -I../symb/include -DNUM_DOUBLE -c -o tensor.o tensor.c
> ar rv ../../lib/symb.a tensor.o
> a - tensor.o
> ranlib -c ../../lib/symb.a
> /Applications/Xcode.app/Contents/Developer/usr/bin/make -C ntools
> clang -g -fsigned-char -std=gnu99 -fPIC -Iinclude -I../../include -I../chep_crt/include -I../plot/include -I../service2/include -I../getmem/include -I../dynamicME/include -I../SLHAplus/include -I../num/include -c -o 1d_integration.o 1d_integration.c
> ar rv /Users/partha/iith/researchsoftwares/micromegas/check/micromegas_6.0.5/CalcHEP_src/lib/ntools.a 1d_integration.o
> ar: creating archive /Users/partha/iith/researchsoftwares/micromegas/check/micromegas_6.0.5/CalcHEP_src/lib/ntools.a
> a - 1d_integration.o
> clang -g -fsigned-char -std=gnu99 -fPIC -Iinclude -I../../include -I../chep_crt/include -I../plot/include -I../service2/include -I../getmem/include -I../dynamicME/include -I../SLHAplus/include -I../num/include -c -o drandXX.o drandXX.c
> ar rv /Users/partha/iith/researchsoftwares/micromegas/check/micromegas_6.0.5/CalcHEP_src/lib/ntools.a drandXX.o
> a - drandXX.o
> clang -g -fsigned-char -std=gnu99 -fPIC -Iinclude -I../../include -I../chep_crt/include -I../plot/include -I../service2/include -I../getmem/include -I../dynamicME/include -I../SLHAplus/include -I../num/include -c -o n_proc.o n_proc.c
> ar rv /Users/partha/iith/researchsoftwares/micromegas/check/micromegas_6.0.5/CalcHEP_src/lib/ntools.a n_proc.o
> a - n_proc.o
> clang -g -fsigned-char -std=gnu99 -fPIC -Iinclude -I../../include -I../chep_crt/include -I../plot/include -I../service2/include -I../getmem/include -I../dynamicME/include -I../SLHAplus/include -I../num/include -c -o polint.o polint.c
> polint.c:98:1: warning: non-void function does not return a value [-Wreturn-type]
> }
> ^
> 1 warning generated.
> ar rv /Users/partha/iith/researchsoftwares/micromegas/check/micromegas_6.0.5/CalcHEP_src/lib/ntools.a polint.o
> a - polint.o
> clang -g -fsigned-char -std=gnu99 -fPIC -Iinclude -I../../include -I../chep_crt/include -I../plot/include -I../service2/include -I../getmem/include -I../dynamicME/include -I../SLHAplus/include -I../num/include -c -o vegas.o vegas.c
> ar rv /Users/partha/iith/researchsoftwares/micromegas/check/micromegas_6.0.5/CalcHEP_src/lib/ntools.a vegas.o
> a - vegas.o
> ranlib -c /Users/partha/iith/researchsoftwares/micromegas/check/micromegas_6.0.5/CalcHEP_src/lib/ntools.a
> /Applications/Xcode.app/Contents/Developer/usr/bin/make -C dynamicME
> clang -g -fsigned-char -std=gnu99 -fPIC -Iinclude -I../SLHAplus/include -I../service2/include -I../chep_crt/include -I../../include -I../ntools/include -DMAKE=\"/Applications/Xcode.app/Contents/Developer/usr/bin/make\" -c -o dynamic_cs.o dynamic_cs.c
> dynamic_cs.c:290:35: warning: for loop has empty body [-Wempty-body]
> for(i=0;Process[i]==' ';i++); if(Process[i]==0)
> ^
> dynamic_cs.c:290:35: note: put the semicolon on a separate line to silence this warning
> dynamic_cs.c:512:32: warning: incompatible pointer types passing 'char *[10]' to parameter of type 'char *' [-Wincompatible-pointer-types]
> if(i==j){ nnew++; sprintf(alias[i],"#_%d",nnew);} else alias[i][0]=0;
> ^~~~~~~~
> /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/secure/_stdio.h:47:28: note: expanded from macro 'sprintf'
> __builtin___sprintf_chk (str, 0, __darwin_obsz(str), __VA_ARGS__)
> ^~~
> dynamic_cs.c:518:18: warning: incompatible pointer types passing 'char *[10]' to parameter of type 'const char *' [-Wincompatible-pointer-types]
> strcpy(process,alias[0]);
> ^~~~~~~~
> /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/secure/_string.h:84:33: note: expanded from macro 'strcpy'
> __builtin___strcpy_chk (dest, __VA_ARGS__, __darwin_obsz (dest))
> ^~~~~~~~~~~
> dynamic_cs.c:523:46: warning: format specifies type 'char *' but the argument has type 'char **' [-Wformat]
> { sprintf(process+strlen(process),"%s", alias[j]); break;}
> ~~ ^~~~~~~~
> /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/secure/_stdio.h:47:56: note: expanded from macro 'sprintf'
> __builtin___sprintf_chk (str, 0, __darwin_obsz(str), __VA_ARGS__)
> ^~~~~~~~~~~
> 4 warnings generated.
> ar rv ../../lib/dynamic_me.a dynamic_cs.o
> ar: creating archive ../../lib/dynamic_me.a
> a - dynamic_cs.o
> clang -g -fsigned-char -std=gnu99 -fPIC -Iinclude -I../SLHAplus/include -I../service2/include -I../chep_crt/include -I../../include -I../ntools/include -DMAKE=\"/Applications/Xcode.app/Contents/Developer/usr/bin/make\" -c -o kin4.o kin4.c
> kin4.c:84:34: error: incompatible function pointer types passing 'double (double, sVarW *)' to parameter of type 'double (*)(double, void *)' [-Wincompatible-function-pointer-types]
> if(n_Gauss) return gauss_arg(intDecay2_,sVar,0,1,n_Gauss);
> ^~~~~~~~~~
> ./../ntools/include/1d_integration.h:6:35: note: passing argument to parameter 'func' here
> extern double gauss_arg( double (*func)(double,void*par),void*par,double a,double b, int n);
> ^
> kin4.c:85:35: error: incompatible function pointer types passing 'double (double, sVarW *)' to parameter of type 'double (*)(double, void *)' [-Wincompatible-function-pointer-types]
> else return simpson_arg(intDecay2_,sVar,0,1,1.E-5,NULL);
> ^~~~~~~~~~
> ./../ntools/include/1d_integration.h:10:37: note: passing argument to parameter 'func' here
> extern double simpson_arg( double (*func)(double,void*par), void*par,double a,double b,double eps, int*err);
> ^
> kin4.c:115:35: error: incompatible function pointer types passing 'double (double, sVarW *)' to parameter of type 'double (*)(double, void *)' [-Wincompatible-function-pointer-types]
> if(n_Gauss) return gauss_arg( intDecay2_,sVar,0,1,n_Gauss)/M_PI/ME(m0,m1,m2);
> ^~~~~~~~~~
> ./../ntools/include/1d_integration.h:6:35: note: passing argument to parameter 'func' here
> extern double gauss_arg( double (*func)(double,void*par),void*par,double a,double b, int n);
> ^
> kin4.c:116:36: error: incompatible function pointer types passing 'double (double, sVarW *)' to parameter of type 'double (*)(double, void *)' [-Wincompatible-function-pointer-types]
> else return simpson_arg( intDecay2_,sVar,0,1,1.E-3,NULL)/M_PI/ME(m0,m1,m2);
> ^~~~~~~~~~
> ./../ntools/include/1d_integration.h:10:37: note: passing argument to parameter 'func' here
> extern double simpson_arg( double (*func)(double,void*par), void*par,double a,double b,double eps, int*err);
> ^
> kin4.c:125:35: error: incompatible function pointer types passing 'double (double, sVarW *)' to parameter of type 'double (*)(double, void *)' [-Wincompatible-function-pointer-types]
> if(n_Gauss) return gauss_arg( intDecay2_,sVar,0,1,n_Gauss)/M_PI/ME(m0,m1,m2);
> ^~~~~~~~~~
> ./../ntools/include/1d_integration.h:6:35: note: passing argument to parameter 'func' here
> extern double gauss_arg( double (*func)(double,void*par),void*par,double a,double b, int n);
> ^
> kin4.c:126:35: error: incompatible function pointer types passing 'double (double, sVarW *)' to parameter of type 'double (*)(double, void *)' [-Wincompatible-function-pointer-types]
> else return simpson_arg(intDecay2_,sVar,0,1,1.E-3,NULL)/M_PI/ME(m0,m1,m2);
> ^~~~~~~~~~
> ./../ntools/include/1d_integration.h:10:37: note: passing argument to parameter 'func' here
> extern double simpson_arg( double (*func)(double,void*par), void*par,double a,double b,double eps, int*err);
> ^
> kin4.c:156:24: error: incompatible function pointer types passing 'double (double, sVarW *)' to parameter of type 'double (*)(double, void *)' [-Wincompatible-function-pointer-types]
> double res=simpson_arg(intDecay1_,sVar,0,1,1E-5,NULL);
> ^~~~~~~~~~
> ./../ntools/include/1d_integration.h:10:37: note: passing argument to parameter 'func' here
> extern double simpson_arg( double (*func)(double,void*par), void*par,double a,double b,double eps, int*err);
> ^
> kin4.c:693:6: warning: using floating point absolute value function 'fabs' when argument is of integer type [-Wabsolute-value]
> if(fabs(pdg2)<=2 && m2<0.14) m2=0.14;
> ^
> kin4.c:693:6: note: use function 'abs' instead
> if(fabs(pdg2)<=2 && m2<0.14) m2=0.14;
> ^~~~
> abs
> kin4.c:694:6: warning: using floating point absolute value function 'fabs' when argument is of integer type [-Wabsolute-value]
> if(fabs(pdg3)<=2 && m3<0.14) m3=0.14;
> ^
> kin4.c:694:6: note: use function 'abs' instead
> if(fabs(pdg3)<=2 && m3<0.14) m3=0.14;
> ^~~~
> abs
> kin4.c:695:6: warning: using floating point absolute value function 'fabs' when argument is of integer type [-Wabsolute-value]
> if(fabs(pdg3)==3 && m2<0.5) m2=0.5;
> ^
> kin4.c:695:6: note: use function 'abs' instead
> if(fabs(pdg3)==3 && m2<0.5) m2=0.5;
> ^~~~
> abs
> kin4.c:696:6: warning: using floating point absolute value function 'fabs' when argument is of integer type [-Wabsolute-value]
> if(fabs(pdg3)==32 && m3<0.5) m3=0.5;
> ^
> kin4.c:696:6: note: use function 'abs' instead
> if(fabs(pdg3)==32 && m3<0.5) m3=0.5;
> ^~~~
> abs
> kin4.c:756:53: warning: add explicit braces to avoid dangling else [-Wdangling-else]
> for(j=1;j<3;j++) if(pdg[j]==23 && VZdecay) s-=6; else if(abs(pdg[j])==24 && VWdecay) s-=5;
> ^
> 5 warnings and 7 errors generated.
> make[3]: *** [kin4.o] Error 1
> rm dynamic_cs.o
> make[2]: *** [all] Error 2
> make[1]: *** [COMPILE] Error 2
> make: *** [all] Error 2
>

Revision history for this message
Partha Kumar Paul (parthakumarpaul) said (last edit ):
#4

Thanks Prof Pukhov, that solved my question.