8, 7, 6, 5, and 4 (for Gaussian) are fixed in the clang_warnings branch. I have solutions for 4 (for FFT) and 2 (the abs/labs part), but I'm not sure how portable they are. See below.
I'll need to think some more about 2 (the Anyval part). ##################### inc is of type PDL_Indx, on my machine that is long, but it could be longlong (and thus need llabs), so this might just be kicking the can down the road: diff --git a/Basic/Core/pdlapi.c b/Basic/Core/pdlapi.c index 43d649d..c709b3d 100644 --- a/Basic/Core/pdlapi.c +++ b/Basic/Core/pdlapi.c @@ -1447,7 +1447,7 @@ void pdl_make_physvaffine(pdl *it) /* inc = the increment at the current stage */ inc = it->vafftrans->incs[i]; incsign = (inc >= 0 ? 1:-1); - inc= abs(inc); + inc= labs(inc); newinc = 0; /* For all dimensions of the current piddle */ for(j=current->ndims-1; j>=0 && current->dimincs[j] != 0; j--) { ##################### Similarly here: types L, N, and Q could need abs, labs, or llabs depending on the implementation. diff --git a/Lib/FFT/fft.pd b/Lib/FFT/fft.pd index 291e055..3bac5a4 100644 --- a/Lib/FFT/fft.pd +++ b/Lib/FFT/fft.pd @@ -561,7 +561,10 @@ pp_def('cdiv', ai = $ai(); br = $br(); bi = $bi(); - if (fabs(br) > fabs(bi)) { + if (types(BU) %{ br > bi %} + types(SL) %{ abs(br) > abs(bi) %} + types(NQ) %{ labs(br) > labs(bi) %} + types(FD) %{ fabs(br) > fabs(bi) %} ) { tt = bi/br; dn = br + tt*bi; $cr() = (ar+tt*ai)/dn; cheers, Derek > On Jun 3, 2016, at 10:44 PM, Derek Lamb <de...@boulder.swri.edu> wrote: > > 1) was addressed in the deprecate-finite branch that was recently merged into > master post-2.016. > > 3) is addressed in the types-printconv branch that has not yet been > merged—needs some code review to make sure it will pass on 32-bit and 64-bit > platforms with different values of ivsize, etc. It hadn't been shaken out > enough yet to merge before 2.016. It probably could be generalized and used > in other places as well. Or even made a little cleaner: generating some > "#define USHORT_FLAG hu" (or whatever) statements in pdl.h instead of the > ugly (but working) current implementation. > > clang complains about a lot of things that really aren't problems or that > fixing may cause more portability problems for different > compilers/architectures. Or that are sort-of-generic code that needs thought > into how to deal with all the different datatypes that a chunk of code might > actually see. So if you'd like to fix them, go ahead, but proceed slowly, > and push to branches, not to master. See the recommended workflow in the > DEVELOPMENT file—it's spelled out step-by-step there. > > cheers, > Derek > >> On Jun 3, 2016, at 10:11 PM, Karl Glazebrook <karlglazebr...@mac.com> wrote: >> >> Any reason why these 8 build warnings in PDL aren’t trivial to fix? [e.g. >> would it break other architectures...] >> >> Yes I’ve been ignoring them for a long time, but perhaps it is time for a >> spring clean? >> >> - Karl >> >> —------------------------------------------------------ >> >> 1) >> >> pdlcore.c:1292:86: warning: format specifies type 'double' but the argument >> has type 'PDL_Indx' (aka 'long') [-Wformat] >> fprintf(stderr,"Warning: pdl_setav_Indx converted undef to (%g) %ld >> time%s\n",undefval,undef_count,undef_count==1?"":"s"); >> ~~ >> ^~~~~~~~ >> %ld >> pdlcore.c:1675:87: warning: format specifies type 'double' but the argument >> has type 'PDL_Short' (aka 'short') [-Wformat] >> fprintf(stderr,"Warning: pdl_setav_Short converted undef to (%g) %ld >> time%s\n",undefval,undef_count,undef_count==1?"":"s"); >> >> >> etc etc etc >> >> ————————————————————————————————— >> >> 2) >> >> pdlapi.c:500:29: warning: format specifies type 'double' but the argument >> has type 'PDL_Anyval' [-Wformat] >> printf("%s%f",(i?" ":""),pdl_get_offs(it,i)); >> ~~ ^~~~~~~~~~~~~~~~~~ >> pdlapi.c:1450:9: warning: absolute value function 'abs' given an argument of >> type 'PDL_Indx' (aka 'long') but has parameter of type 'int' which may cause >> truncation of value [-Wabsolute-value] >> inc= abs(inc); >> ^ >> pdlapi.c:1450:9: note: use function 'labs' instead >> inc= abs(inc); >> >> ————————————————————————————————— >> >> 3) in Bad.xs Math.xs and Ufunc.xs a lot of: >> >> >> Math.xs:13157:43: warning: 'finite' is deprecated: first deprecated in OS X >> 10.9 [-Wdeprecated-declarations] >> (c_datap)[0] PDL_COMMENT("ACCESS()") = ( finite((a_datap)[0] >> PDL_COMMENT("ACCESS()") ) && (a_datap)[0] PDL_COMMENT("ACCESS()") != >> a_badval ) ? (a_dat... >> ^ >> /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/math.h:757:12: >> note: 'finite' has been >> explicitly marked deprecated here >> extern int finite(double) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, >> __MAC_10_9, __IPHONE_NA, __IPHONE_NA); >> >> >> etc… >> >> ————————————————————————————————— >> >> >> 4) Gaussian.xs and FFT.xs a lot of: >> >> >> Gaussian.xs:672:18: warning: using integer absolute value function 'abs' >> when argument is of floating point type [-Wabsolute-value] >> if ( >> abs((xval_datap)[0+(__inc_xval_n*PP_INDTERM(__privtrans->__n_size, n))] >> PDL_COMMENT("ACCESS()") -xmin) > 0.9*abs(xmax-xmin) ) { >> ^ >> Gaussian.xs:672:18: note: use function 'fabs' instead >> if ( >> abs((xval_datap)[0+(__inc_xval_n*PP_INDTERM(__privtrans->__n_size, n))] >> PDL_COMMENT("ACCESS()") -xmin) > 0.9*abs(xmax-xmin) ) { >> ^~~ >> fabs >> >> >> etc. >> ————————————————————————————————— >> >> >> 5) >> >> >> resample.c:292:14: warning: implicitly declaring library function 'strcmp' >> with type 'int (const char *, const char *)' >> } else if (!strcmp(kernel_type, "default")) { >> ^ >> resample.c:292:14: note: include the header <string.h> or explicitly provide >> a declaration for 'strcmp' >> 1 warning generated. >> >> >> 6) ./SlatecProtos.h:1:8: warning: type specifier missing, defaults to 'int' >> [-Wimplicit-int] >> extern ssvdc_ (); >> ~~~~~~ ^ >> ./SlatecProtos.h:2:8: warning: type specifier missing, defaults to 'int' >> [-Wimplicit-int] >> extern spoco_ (); >> ~~~~~~ ^ >> >> ————————————————————————————————— >> >> >> 7) >> >> INTEG.xs:18122:10: warning: implicit declaration of function 'warn' is >> invalid in C99 [-Wimplicit-function-declaration] >> warn("Bounds checking is disabled for PDL::GSL::INTEG"); >> ————————————————————————————————— >> >> ^ >> >> 8) RNG.xs:48112:10: warning: enumeration values 'PDL_IND' and 'PDL_LL' not >> handled in switch [-Wswitch] >> switch(in->datatype) { >> >> >> >> >> >> >> >> >> >> ------------------------------------------------------------------------------ >> What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic >> patterns at an interface-level. Reveals which users, apps, and protocols are >> consuming the most bandwidth. Provides multi-vendor support for NetFlow, >> J-Flow, sFlow and other flows. Make informed decisions using capacity >> planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e >> _______________________________________________ >> pdl-devel mailing list >> pdl-devel@lists.sourceforge.net >> https://lists.sourceforge.net/lists/listinfo/pdl-devel >> > > > ------------------------------------------------------------------------------ > What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic > patterns at an interface-level. Reveals which users, apps, and protocols are > consuming the most bandwidth. Provides multi-vendor support for NetFlow, > J-Flow, sFlow and other flows. Make informed decisions using capacity > planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e > _______________________________________________ > pdl-devel mailing list > pdl-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/pdl-devel > ------------------------------------------------------------------------------ What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic patterns at an interface-level. Reveals which users, apps, and protocols are consuming the most bandwidth. Provides multi-vendor support for NetFlow, J-Flow, sFlow and other flows. Make informed decisions using capacity planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e _______________________________________________ pdl-devel mailing list pdl-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/pdl-devel