On Thu, 2008-07-17 at 21:10 +0000, Eric Rannaud wrote:
> On Thu, 2008-07-17 at 16:57 -0400, Jonathan S. Shapiro wrote:
> > On Thu, 2008-07-17 at 20:54 +0000, Eric Rannaud wrote:
> > > Oh, and there is another case I forget, for which you would need
> > > language support:
> > >
> > > struct a {
> > > int x, y;
> > > #ifdef DEPRECATED_FEATURE /* too go in 2 revisions */
> > > char c;
> > > #endif
> > > };
> >
> > This is definitely not something that should be done with the
> > preprocessor. In this particular case, what you are looking for is an
> > annotation.
>
> OK, I don't understand what you mean by annotation. Unless my example
> was too specific, and you mean annotation for "deprecated"?
Yes.
> A better example would be, from the Linux kernel:
>
> struct rt_mutex_waiter {
> struct plist_node list_entry;
> struct plist_node pi_list_entry;
> struct task_struct *task;
> struct rt_mutex *lock;
> #ifdef CONFIG_DEBUG_RT_MUTEXES
> unsigned long ip;
> struct pid *deadlock_task_pid;
> struct rt_mutex *deadlock_lock;
> #endif
> };
This is probably a better example, but I'm suspicious that this really
shouldn't have been handled this way. When we pull out these examples,
the goal should be to find a principled solution first, and only look at
conditional compilation when that fails.
shap
_______________________________________________
bitc-dev mailing list
[email protected]
http://www.coyotos.org/mailman/listinfo/bitc-dev