From: Al Viro <viro@ftp.linux.org.uk>
To: Thomas Schmid <Thomas.Schmid@br-automation.com>
Cc: linux-sparse@vger.kernel.org
Subject: Re: Differences in the behaviour of sparse and gcc within cygwin environment
Date: Fri, 18 May 2007 21:47:35 +0100 [thread overview]
Message-ID: <20070518204735.GY4095@ftp.linux.org.uk> (raw)
In-Reply-To: <OFD0819B39.CB485382-ONC12572DF.003FFDE5-C12572DF.004060F0@br-automation.com>
On Fri, May 18, 2007 at 01:43:11PM +0200, Thomas Schmid wrote:
> I use sparse in a cygwin environment to obtain pre-build info from
> sourcefiles which get comiled with gcc (also compiled with cygwin).
>
> After some time of using sparse, I noticed some differences in the
> behaviour of sparse and gcc:
> 1. Symbolnames with "$" are accepted by gcc but not by sparse
ewww... It's not hard to change, but I strongly recommend making it
ifdefed and *not* included on sane boxen. Rationale: that affects one
of the hottest paths in the entire thing.
Who uses $ in identifiers, anyway, when it's guaranteed to be non-portable?
gcc accepts it as a bloody misguided extension, but it's not standard C by
any stretch of imagination. What are you working with, a bunch of old code
originating on VMS?
> 2. #include "..\plc.h" is accepted by gcc but not by sparse => "\" is
> interpreted as escape- character
> 3. #include "D:\plc.h" is accepted by gcc but not by sparse
*argh*
sparse takes a shortcut - it treats header-name as string-literal. In
principle, these are distinct tokens. We could try to change that, but...
that makes tokenizer context-dependent in a fairly upleasant way.
Note that \ in header-name is explicitly undefined behaviour (6.4.7(3)),
and compilers I've seen on weird systems of that kind tend to remap / on \
in header names anyway before trying to look for files to include.
next prev parent reply other threads:[~2007-05-18 20:47 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-05-18 11:43 Differences in the behaviour of sparse and gcc within cygwin environment Thomas Schmid
2007-05-18 20:47 ` Al Viro [this message]
2007-05-21 13:20 ` Antwort: " Thomas Schmid
2007-05-21 23:16 ` Josh Triplett
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20070518204735.GY4095@ftp.linux.org.uk \
--to=viro@ftp.linux.org.uk \
--cc=Thomas.Schmid@br-automation.com \
--cc=linux-sparse@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).