bugmake - Bugs: bug #46304, HAVE_CASE_INSENSITIVE_FS breaks...


bug #46304: HAVE_CASE_INSENSITIVE_FS breaks default rules since 3.99.90

Submitter:  None
Submitted:  Mon 26 Oct 2015 11:05:36 PM UTC
Severity:  2 - Minor Item Group:  Bug
Status:  Fixed Privacy:  Public
Assigned to:  None Open/Closed:  Closed
Component Version:  4.1 Operating System:  MS Windows
Fixed Release:  4.2 Triage Status:  Small Effort
* Mandatory Fields

Add a New Comment Rich Markup

Tue 27 Oct 2015 07:51:07 PM UTC, comment #2: 

Thank you Eli for the super quick fix and clarifications on the status of the case-insentivity option.

I confirm the issue being corrected as of http://git.savannah.gnu.org/cgit/make.git/commit/?id=4a5377aef7a6093a8cc4ab76d5ad37ca3592b44c.

- <_101509>
Tue 27 Oct 2015 06:59:51 PM UTC, comment #1: 

I don't see any change in built-in rules that could possibly cause this.  I think the cause is different: Make now sorts the built-in rules in a consistent, predictable order, and it just so happens that the .C.o rule is now tried before the .c.o one (and obviously succeeds under HAVE_CASE_INSENSITIVE_FS).

IOW, that it worked in Make 3.81 was sheer luck, nothing else, an implementation detail that determined an otherwise undefined behavior.

I have now fixed this in the repository by making COMPILE.C and LINK.C be synonyms of COMPILE.c and LINK.c when Make is compiled with this option turned on.

A comment about README.W32: it's not true that we recommend using HAVE_CASE_INSENSITIVE_FS on MS-Windows.  We just mention this option as one of those users might wish activating.  I've now modified README.W32 to make this even more clear.


Eli Zaretskii <eliz>
Group Member
Mon 26 Oct 2015 11:05:36 PM UTC, original submission:  


Somewhere between 3.81.90 and 3.99.90 the built-in rule for .c files got changed to call `g++` instead of `cc`, when using ./configure option `--enable-case-insensitive-file-system` or the corresponding build-time macro `HAVE_CASE_INSENSITIVE_FS`. This is the recommended way to build under Windows, as per README.w32. The problem is still present in latest version 4.1 and even in the Git master repository.

The problem is likely caused by internal confusion about .C and .c extensions differing only in casing, where the former implies C++, while the latter is expected to imply plain C - even on Windows - but it implies C++ instead.

The end result is that certain plain C sources cannot be compiled, as it is being fed to the C++ compiler, which is much more picky about the language and might also generate incompatible object files.

Reproducible using a zero-length `test.c` file and following `Makefile` in the same directory:

Running `mingw-make.exe` results in:
3.81.90 (ok):
cc     test.c   -o test

3.99.90 (not OK):
g++     test.c   -o test

Also apparent by listing built-in rules using -p option:
`mingw32-make.exe -p`

3.81.90 (ok):
%.o: %.c
#  recipe to execute (built-in):

3.99.90 (not OK):
%.o: %.c
#  recipe to execute (built-in):

Example Windows binary that
- exhibit the problem (= built with the HAVE_CASE_INSENSITIVE_FS option):
- is working correctly (= built without the HAVE_CASE_INSENSITIVE_FS option):

Additional information on this URL:




(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by eliz (Posted a comment)

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.


    Follow 7 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2015-10-27 eliz Severity3 - Normal 2 - Minor
        StatusNone Fixed
        Open/ClosedOpen Closed
        Component Version4.0 4.1
        Fixed ReleaseNone 4.2
        Triage StatusNone Small Effort
    2015-10-26 _101509 Carbon-Copy- Added vsz

    Back to the top

    Powered by Savane 3.13-4b48.
    Corresponding source code