Skip to content
Snippets Groups Projects
Commit 4e6c8019 authored by Matthew Pickering's avatar Matthew Pickering Committed by Marge Bot
Browse files

Always define __GLASGOW_HASKELL_PATCHLEVEL1/2__ macros

As #21076 reports if you are using `-Wcpp-undef` then you get warnings
when using the `MIN_VERSION_GLASGOW_HASKELL` macro because
__GLASGOW_HASKELL_PATCHLEVEL2__ is very rarely explicitliy set (as
version numbers are not 4 components long).

This macro was introduced in 3549c952
and it seems the bug has existed ever since.

Fixes #21076
parent 4127e86d
No related branches found
No related tags found
No related merge requests found
......@@ -77,6 +77,10 @@ AC_DEFUN([FP_SETUP_PROJECT_VERSION],
ProjectPatchLevel1=`echo $ProjectPatchLevel | sed 's/^\(@<:@^.@:>@*\)\(\.\{0,1\}\(.*\)\)$/\1/'`
ProjectPatchLevel2=`echo $ProjectPatchLevel | sed 's/^\(@<:@^.@:>@*\)\(\.\{0,1\}\(.*\)\)$/\3/'`
# The project patchlevel1/2 is zero unless stated otherwise
test -z "$ProjectPatchLevel1" && ProjectPatchLevel1=0
test -z "$ProjectPatchLevel2" && ProjectPatchLevel2=0
AC_SUBST([ProjectPatchLevel1])
AC_SUBST([ProjectPatchLevel2])
......
......@@ -303,3 +303,4 @@ test('T20200loop', extra_files(['T20200loop']), multimod_compile,
['Datatypes', '-iT20200loop -O -v0'])
test('T20316', normal, makefile_test, [])
test('MultiRootsErr', normal, multimod_compile_fail, ['MultiRootsErr', 'MultiRootsErr'])
test('patch-level2', normal, compile, ['-Wcpp-undef'])
{-# LANGUAGE CPP #-}
module PatchLevel2 where
p2 = __GLASGOW_HASKELL_PATCHLEVEL2__
p1 = __GLASGOW_HASKELL_PATCHLEVEL1__
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment