ghcjs / ghcjs-base

base library for GHCJS for JavaScript interaction and marshalling, used by higher level libraries like JSC
MIT License
45 stars 67 forks source link

Fix compiler warnings. #79

Open crocket opened 7 years ago

crocket commented 7 years ago

When I compiled ghcjs-base with ghcjs-0.2.0.9006021_ghc-7.10.3 from http://ghcjs.tolysz.org/lts-6.21-9006021.tar.gz, ghcjs gave the following warnings.

The warnings are sorted.

/home/crocket/repos/other/ghcjs-base/JavaScript/JSON/Types/Generic.hs:2:45: Warning:
    -XOverlappingInstances is deprecated: instead use per-instance pragmas OVERLAPPING/OVERLAPPABLE/OVERLAPS

/home/crocket/repos/other/ghcjs-base/JavaScript/JSON/Types/Instances.hs:2:54: Warning:
    -XOverlappingInstances is deprecated: instead use per-instance pragmas OVERLAPPING/OVERLAPPABLE/OVERLAPS
/home/crocket/repos/other/ghcjs-base/JavaScript/TypedArray/Internal/Types.hs:111:5: Warning:
    Overlapped type family instance equation:
    forall (k :: BOX) (s :: k). Elem (STUint8Array s) = Word8

/home/crocket/repos/other/ghcjs-base/JavaScript/TypedArray/Internal/Types.hs:112:5: Warning:
    Overlapped type family instance equation:
    forall (k :: BOX) (s :: k). Elem (STUint8ClampedArray s) = Word8

/home/crocket/repos/other/ghcjs-base/JavaScript/TypedArray/Internal/Types.hs:113:5: Warning:
    Overlapped type family instance equation:
    forall (k :: BOX) (s :: k). Elem (STUint16Array s) = Word16

/home/crocket/repos/other/ghcjs-base/JavaScript/TypedArray/Internal/Types.hs:114:5: Warning:
    Overlapped type family instance equation:
    forall (k :: BOX) (s :: k). Elem (STUint32Array s) = Word

/home/crocket/repos/other/ghcjs-base/JavaScript/TypedArray/Internal/Types.hs:115:5: Warning:
    Overlapped type family instance equation:
    forall (k :: BOX) (s :: k). Elem (STInt8Array s) = Int8

/home/crocket/repos/other/ghcjs-base/JavaScript/TypedArray/Internal/Types.hs:116:5: Warning:
    Overlapped type family instance equation:
    forall (k :: BOX) (s :: k). Elem (STInt16Array s) = Int16

/home/crocket/repos/other/ghcjs-base/JavaScript/TypedArray/Internal/Types.hs:117:5: Warning:
    Overlapped type family instance equation:
    forall (k :: BOX) (s :: k). Elem (STInt32Array s) = Int

/home/crocket/repos/other/ghcjs-base/JavaScript/TypedArray/Internal/Types.hs:118:5: Warning:
    Overlapped type family instance equation:
    forall (k :: BOX) (s :: k). Elem (STFloat32Array s) = Double

/home/crocket/repos/other/ghcjs-base/JavaScript/TypedArray/Internal/Types.hs:119:5: Warning:
    Overlapped type family instance equation:
    forall (k :: BOX) (s :: k). Elem (STFloat64Array s) = Double
/home/crocket/repos/other/ghcjs-base/GHCJS/Foreign/Internal.hs:93:1: Warning:
    Module ‘Foreign.ForeignPtr.Safe’ is deprecated:
      Safe is now the default, please use Foreign.ForeignPtr instead
/home/crocket/repos/other/ghcjs-base/Data/JSString/Int.hs:38:1: Warning:
    SPECIALISE pragma on INLINE function probably won't fire: ‘decimal’

/home/crocket/repos/other/ghcjs-base/Data/JSString/Int.hs:39:1: Warning:
    SPECIALISE pragma on INLINE function probably won't fire: ‘decimal’

/home/crocket/repos/other/ghcjs-base/Data/JSString/Int.hs:40:1: Warning:
    SPECIALISE pragma on INLINE function probably won't fire: ‘decimal’

/home/crocket/repos/other/ghcjs-base/Data/JSString/Int.hs:41:1: Warning:
    SPECIALISE pragma on INLINE function probably won't fire: ‘decimal’

/home/crocket/repos/other/ghcjs-base/Data/JSString/Int.hs:42:1: Warning:
    SPECIALISE pragma on INLINE function probably won't fire: ‘decimal’

/home/crocket/repos/other/ghcjs-base/Data/JSString/Int.hs:43:1: Warning:
    SPECIALISE pragma on INLINE function probably won't fire: ‘decimal’

/home/crocket/repos/other/ghcjs-base/Data/JSString/Int.hs:44:1: Warning:
    SPECIALISE pragma on INLINE function probably won't fire: ‘decimal’

/home/crocket/repos/other/ghcjs-base/Data/JSString/Int.hs:45:1: Warning:
    SPECIALISE pragma on INLINE function probably won't fire: ‘decimal’

/home/crocket/repos/other/ghcjs-base/Data/JSString/Int.hs:46:1: Warning:
    SPECIALISE pragma on INLINE function probably won't fire: ‘decimal’

/home/crocket/repos/other/ghcjs-base/Data/JSString/Int.hs:47:1: Warning:
    SPECIALISE pragma on INLINE function probably won't fire: ‘decimal’

/home/crocket/repos/other/ghcjs-base/Data/JSString/Int.hs:48:1: Warning:
    SPECIALISE pragma on INLINE function probably won't fire: ‘decimal’

/home/crocket/repos/other/ghcjs-base/Data/JSString/Int.hs:132:1: Warning:
    SPECIALISE pragma on INLINE function probably won't fire: ‘hexadecimal’

/home/crocket/repos/other/ghcjs-base/Data/JSString/Int.hs:133:1: Warning:
    SPECIALISE pragma on INLINE function probably won't fire: ‘hexadecimal’

/home/crocket/repos/other/ghcjs-base/Data/JSString/Int.hs:134:1: Warning:
    SPECIALISE pragma on INLINE function probably won't fire: ‘hexadecimal’

/home/crocket/repos/other/ghcjs-base/Data/JSString/Int.hs:135:1: Warning:
    SPECIALISE pragma on INLINE function probably won't fire: ‘hexadecimal’

/home/crocket/repos/other/ghcjs-base/Data/JSString/Int.hs:136:1: Warning:
    SPECIALISE pragma on INLINE function probably won't fire: ‘hexadecimal’

/home/crocket/repos/other/ghcjs-base/Data/JSString/Int.hs:137:1: Warning:
    SPECIALISE pragma on INLINE function probably won't fire: ‘hexadecimal’

/home/crocket/repos/other/ghcjs-base/Data/JSString/Int.hs:138:1: Warning:
    SPECIALISE pragma on INLINE function probably won't fire: ‘hexadecimal’

/home/crocket/repos/other/ghcjs-base/Data/JSString/Int.hs:139:1: Warning:
    SPECIALISE pragma on INLINE function probably won't fire: ‘hexadecimal’

/home/crocket/repos/other/ghcjs-base/Data/JSString/Int.hs:140:1: Warning:
    SPECIALISE pragma on INLINE function probably won't fire: ‘hexadecimal’

/home/crocket/repos/other/ghcjs-base/Data/JSString/Int.hs:141:1: Warning:
    SPECIALISE pragma on INLINE function probably won't fire: ‘hexadecimal’

/home/crocket/repos/other/ghcjs-base/Data/JSString/Int.hs:142:1: Warning:
    SPECIALISE pragma on INLINE function probably won't fire: ‘hexadecimal’

/home/crocket/repos/other/ghcjs-base/Data/JSString/RealFloat.hs:29:1: Warning:
    Ignoring useless SPECIALISE pragma for NOINLINE function: ‘realFloat’

/home/crocket/repos/other/ghcjs-base/Data/JSString/RealFloat.hs:30:1: Warning:
    Ignoring useless SPECIALISE pragma for NOINLINE function: ‘realFloat’

/home/crocket/repos/other/ghcjs-base/Data/JSString/RealFloat.hs:41:1: Warning:
    Ignoring useless SPECIALISE pragma for NOINLINE function: ‘formatRealFloat’

/home/crocket/repos/other/ghcjs-base/Data/JSString/RealFloat.hs:42:1: Warning:
    Ignoring useless SPECIALISE pragma for NOINLINE function: ‘formatRealFloat’
/home/crocket/repos/other/ghcjs-base/JavaScript/JSON/Types/Internal.hs:11:7: Warning:
    ‘MutableValue’ is exported by ‘MutableValue’ and ‘MutableValue’

/home/crocket/repos/other/ghcjs-base/JavaScript/JSON/Types/Internal.hs:11:21: Warning:
    ‘MutableValue'’ is exported by ‘MutableValue'’ and ‘MutableValue'’
/home/crocket/repos/other/ghcjs-base/GHCJS/Marshal.hs:28:1: Warning:
    Module ‘Data.Attoparsec.Number’ is deprecated:
      This module will be removed in the next major release.

/home/crocket/repos/other/ghcjs-base/JavaScript/JSON/Types/Instances.hs:71:1: Warning:
    Module ‘Data.Attoparsec.Number’ is deprecated:
      This module will be removed in the next major release.

/home/crocket/repos/other/ghcjs-base/JavaScript/JSON/Types/Instances.hs:1067:37: Warning:
    In the use of type constructor or class ‘Number’
    (imported from Data.Attoparsec.Number):
    Deprecated: "This module will be removed in the next major release."

/home/crocket/repos/other/ghcjs-base/JavaScript/JSON/Types/Instances.hs:1069:19: Warning:
    In the use of data constructor ‘D’
    (imported from Data.Attoparsec.Number):
    Deprecated: "This module will be removed in the next major release."

/home/crocket/repos/other/ghcjs-base/JavaScript/JSON/Types/Instances.hs:1070:19: Warning:
    In the use of data constructor ‘I’
    (imported from Data.Attoparsec.Number):
    Deprecated: "This module will be removed in the next major release."
/home/crocket/repos/other/ghcjs-base/JavaScript/JSON/Types/Instances.hs:494:17: Warning:
    In the use of ‘parseTime’
    (imported from Data.Time.Format, but defined in time-1.5.0.1:Data.Time.Format.Parse):
    Deprecated: "use "parseTimeM True" instead"

/home/crocket/repos/other/ghcjs-base/JavaScript/JSON/Types/Instances.hs:516:16: Warning:
    In the use of ‘parseTime’
    (imported from Data.Time.Format, but defined in time-1.5.0.1:Data.Time.Format.Parse):
    Deprecated: "use "parseTimeM True" instead"

/home/crocket/repos/other/ghcjs-base/JavaScript/JSON/Types/Instances.hs:539:14: Warning:
    In the use of ‘parseTime’
    (imported from Data.Time.Format, but defined in time-1.5.0.1:Data.Time.Format.Parse):
    Deprecated: "use "parseTimeM True" instead"
tippenein commented 7 years ago

The specialise errors are erroneously reported and it's an upstream ghc issue - https://ghc.haskell.org/trac/ghc/ticket/10721

It seems like the overlapping type family instance warnings are very old upstream ghc issues - https://ghc.haskell.org/trac/ghc/ticket/4259

The only one that seems like some amount of work is Attoparsec's Number module (which suggests using scientific instead)