[<prev] [next>] [day] [month] [year] [list]
Message-ID: <F61457A753D573478DB768F576EEDBDB2AD019EE@SJEXCHMB09.corp.ad.broadcom.com>
Date: Fri, 29 May 2015 18:55:00 +0000
From: John Ulvr <julvr@...adcom.com>
To: "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Detection of case senstive filenames
There are several files in Linux whose names only differ by capitalization. This has caused us some support issues due to third party filesystems/revision control systems, which overwrite the wrong file, causing non-obvious compilation errors. I recently added a more obvious compile time failure to some of these files to reduce the number of support calls we get on the subject. I thought I'd bring it up in case someone thinks it might be a good idea to move this to the mainstream kernel. The code is:
/* if your compiler generates an error here, it is likely due to a filename-capitalization error, caused by a case-insensitive filesystem or revision control system */
#define __CHECK_FILENAME(filename) \
static int __checkfname __attribute__((unused)) = (1/((__builtin_strcmp((__FILE__ + __builtin_strlen(__FILE__) - __builtin_strlen(filename)), filename))?0:1))
__CHECK_FILENAME("xt_dscp.c");
(This would appear at the bottom of xt_DSCP.c, xt_dscp.c, etc. in global scope). While not overly pretty, it does point out what the actual error is, and doesn't have any side-effects. If there's interest, let me know and I can try to push it upstream.
John
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists