[RFC] [WIP] incorporate picotcp into barebox: a small demo

Antony Pavlov antonynpavlov at gmail.com
Wed May 28 03:32:29 PDT 2014


On Wed, 28 May 2014 09:23:30 +0200
Juergen Borleis <jbe at 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 at doce:~$ cat > test.c <<EOF;
int main()
{
#ifdef SOME_UNDEFINED_MACRO
        foo bar;
        фу бар;
#endif
	return 0;
}
EOF
antony at doce:~$ gcc test.c 
antony at doce:~$ ./a.out 
antony at doce:~$ ./a.out 
antony at doce:~$ echo $
0

-- 
Best regards,
  Antony Pavlov



More information about the barebox mailing list