mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Antony Pavlov <antonynpavlov@gmail.com>
To: Juergen Borleis <jbe@pengutronix.de>
Cc: Kristof Roelants <kristof.roelants@tass.be>,
	barebox@lists.infradead.org,
	Daniele Lacamera <daniele.lacamera@tass.be>,
	Daniele Lacamera <mlists@danielinux.net>,
	Sam Van Den Berge <sam.van.den.berge@tass.be>
Subject: Re: [RFC] [WIP] incorporate picotcp into barebox: a small demo
Date: Wed, 28 May 2014 14:32:29 +0400	[thread overview]
Message-ID: <20140528143229.d5f41058f68d590b8e13e1f5@gmail.com> (raw)
In-Reply-To: <201405280923.30797.jbe@pengutronix.de>

On Wed, 28 May 2014 09:23:30 +0200
Juergen Borleis <jbe@pengutronix.de> wrote:

> Hi Antony,
> 
> On Tuesday 27 May 2014 16:04:11 Antony Pavlov wrote:
> > [...]
> > If you use #ifdef:
> >
> >         #ifdef CONFIG_DEBUG_FS
> >                 err = tegra_dsi_debugfs_init(dsi, tegra->drm->primary);
> >                 if (err < 0)
> >                         dev_err(dsi->dev, "debugfs setup failed: %d\n", err);
> >         #endif 
> >    
> > then you get jut the same result but without checking the code under #ifdef
> > CONFIG_DEBUG_FS.
> 
> A syntax check is always done by the pre-processor. So, the code between the

Yes, the C pre-processor checks the syntax for input, but only the C pre-procesor directive syntax!
But here I mean exactly C code checking.

> #ifdef/#endif must be valid C code or be commented out.
> But there is no further check, because the lines between the #ifdef/#endif are
> never seen by the compiler.
> 

That's exactly what I mean! E.g.

antony@doce:~$ cat > test.c <<EOF;
int main()
{
#ifdef SOME_UNDEFINED_MACRO
        foo bar;
        фу бар;
#endif
	return 0;
}
EOF
antony@doce:~$ gcc test.c 
antony@doce:~$ ./a.out 
antony@doce:~$ ./a.out 
antony@doce:~$ echo $
0

-- 
Best regards,
  Antony Pavlov

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

      reply	other threads:[~2014-05-28 10:21 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-25  9:58 Antony Pavlov
2014-05-26  9:35 ` Daniele Lacamera
2014-05-26  9:45 ` Lucas Stach
2014-05-26 12:09   ` Antony Pavlov
2014-05-27  5:30     ` Sascha Hauer
2014-05-27  7:52       ` Daniele Lacamera
2014-05-27  9:46     ` Daniele Lacamera
2014-05-27 14:04       ` Antony Pavlov
2014-05-27 17:26         ` Daniele Lacamera
2014-05-29  5:40           ` Antony Pavlov
2014-05-28  6:08         ` Sascha Hauer
2014-05-28  7:23         ` Juergen Borleis
2014-05-28 10:32           ` Antony Pavlov [this message]

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=20140528143229.d5f41058f68d590b8e13e1f5@gmail.com \
    --to=antonynpavlov@gmail.com \
    --cc=barebox@lists.infradead.org \
    --cc=daniele.lacamera@tass.be \
    --cc=jbe@pengutronix.de \
    --cc=kristof.roelants@tass.be \
    --cc=mlists@danielinux.net \
    --cc=sam.van.den.berge@tass.be \
    /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