3

I want to make MinGW validate that the file names specified in #include directives are case correct. MinGW is case insensitive by default, probably because windows is case insensitive when it comes to filenames, but I am working in a cross platform environment, and want to make sure that gcc doesn't complain under Linux when somebody specifies an include file with the wrong case.

I thought there might be a compile switch to force this, but haven't been able to find one. Any alternative suggestions would also be welcome.

Dan
  • 125
  • 6

2 Answers2

1

I don't think MinGW has any such option. If you assume you're running on NTFS, at least, it would probably not be too difficult to code it up and contribute a patch. But the easiest solution by far is to simply remind people to be case correct, and fix the (hopefully rare!) instances where they slip up.

Sometimes the best solution is social, rather than technical.

Ben Karel
  • 4,591
  • 2
  • 26
  • 25
  • Fair call Ben, the social approach sounds like it'll be less effort than the technical one. I was just looking for a way to provide advanced notice that something wasn't going to work in different conditions. If that can't be done though I'm happy to just gently remind people if they use incorrect case. – Dan Nov 25 '10 at 22:15
  • Yeah, it's a good goal, and it's not that it can't be done at all, but the pain of setting up and maintaining such a system is just likely to outweigh the benefits it would give. YMMV of course! – Ben Karel Nov 26 '10 at 03:25
0

I can not think about a direct solution, than writing some custom tool to check this :) Win32 subsystems generally imposes case insensivity, which makes it impossible to have a case-sensitive file request on Windows. At least on FATxx and NTFS file systems case-insensivity is imposed. I have not tried an NFS mounted file system. If it is an option, you could just have a try..

SJOE
  • 1