Closed jeff-regier closed 7 years ago
I still see a few warnings when I run the tests.
julia> Pkg.test("FITSIO")
INFO: Testing FITSIO
WARNING: Method definition cfitsio_typecode(Type{Int64}) in module Libcfitsio at /home/jeff/.julia/v0.5/FITSIO/src/libcfitsio.jl:164 overwritten at /home/jeff/.julia/v0.5/FITSIO/src/libcfitsio.jl:164.
WARNING: Base.ASCIIString is deprecated, use String instead.
likely near /home/jeff/.julia/v0.5/FITSIO/src/libcfitsio.jl:356
WARNING: Base.ASCIIString is deprecated, use String instead.
likely near /home/jeff/.julia/v0.5/FITSIO/src/libcfitsio.jl:356
WARNING: deprecated syntax "[a=>b for (a,b) in c]".
Use "Dict(a=>b for (a,b) in c)" instead.
WARNING: Base.ASCIIString is deprecated, use String instead.
likely near /home/jeff/.julia/v0.5/FITSIO/test/runtests.jl:118
All tests passed.
INFO: FITSIO tests passed
If you can see how to fix these, please let me know.
Did this fix all the warnings?
Two warnings left:
WARNING: Method definition cfitsio_typecode(Type{Int64}) in module Libcfitsio at /home/jeff/.julia/v0.5/FITSIO/src/libcfitsio.jl:164 overwritten at /home/jeff/.julia/v0.5/FITSIO/src/libcfitsio.jl:164.
and
WARNING: deprecated syntax "[a=>b for (a,b) in c]".
Use "Dict(a=>b for (a,b) in c)" instead.
The second warning is easily fixed by replacing line 114 with
map = Dict(keys[i] => i for i in 1:length(keys))
but that breaks compatibility with Julia 0.4. I don't see a macro in Compat.jl that solves the problem
Could just remove the comprehension: initialize an empty Dict{String, Int}
and fill it in a loop.
The other warning is because Clong
is Int64
on your system. Unrelated to Julia version changes, but maybe there's better method redefinition warnings on 0.5. You could try fixing this with a conditional (only define cfitsio_typecode(Type{Clong})
if Clong
is not Int64
) or it can be done in a separate PR.
OK, I think this is done now. I'll leave the method definition for another PR.
Thanks Jeff, looks good.
Hi @kbarbary -- This fixes the vast majority of warnings from Julia 0.5, without breaking any backward compatibility, I think.