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

gcc warnings on Fedora #34

Open
alxpl opened this issue Feb 16, 2019 · 0 comments
Open

gcc warnings on Fedora #34

alxpl opened this issue Feb 16, 2019 · 0 comments

Comments

@alxpl
Copy link

alxpl commented Feb 16, 2019

Hello,

I was interested in packaging CarbonXS GUI for fedora and I started by looking into the compilation of the Fortran code (gcc-gfortran-8.2.1 on Fedora 29). Fedora has a default set of compiler flags for C, C++ and Fortran, which should be used for the compilation of all executables.
In the case of F29, these are:

$ rpm --eval %{optflags}
-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection

Using these, the compilation completes, albeit with a bunch of warnings, e.g.:

f951: Warning: Nonconforming tab character in column 1 of line 47 [-Wtabs]
[…]
carbon.cmn:11:14:

  LOGICAL DERIV
              1
Warning: Nonconforming tab character at (1) [-Wtabs]
[…]
CARBONXS.FOR:1176:72:

             PAUSE 'Improper permutation in LISTA'
                                                                        1
Warning: Deleted feature: PAUSE statement at (1)
[…]
CARBONXS.FOR:945:25:

         E1PIL =EXP(CMPLX(0.0D0,1*PI*L))
                         1
Warning: Conversion from REAL(8) to default-kind COMPLEX(4) at (1) might lose precision, consider using the KIND argument [-Wconversion]
[…]
CARBONXS.FOR:1090:21:

         INTEGER N,ILS,IS,I,IU
                     1
Warning: Unused variable ‘ils’ declared at (1) [-Wunused-variable]
[…]
CARBONXS.FOR:849:0:

           DD002=DD002+(DGDL*CS+G*DCSDL)*ET*POC*DLDD
 
Warning: ‘dldd’ may be used uninitialized in this function [-Wmaybe-uninitialized]

and so on. In addition to the above, when the program is run, this appears at the end of its output:
Note: The following floating-point exceptions are signalling: IEEE_INVALID_FLAG IEEE_DIVIDE_BY_ZERO IEEE_OVERFLOW_FLAG IEEE_UNDERFLOW_FLAG IEEE_DENORMAL
Now, to be honest, I haven't touched any Fortran code in over a decade, nor have I kept an eye on any developments during this time, so I am the least qualified person to give advice, but I think it would be worth it weeding out the false positives and hardening the code.

Fedora 30 comes with GCC9, which carries a host of new features and modifications and I intend to check what happens there as well.

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