Re: Ugh in 2.1.60

teunis (teunis@mauve.computersupportcentre.com)
Fri, 31 Oct 1997 11:41:51 -0700 (MST)


On Fri, 31 Oct 1997, David Woodhouse wrote:

>
> whawes@star.net said:
> > That sounds good -- maybe print just one message, and identify the
> > file and line number. It would be good to get this all cleared up
> > before 2.2.
>
> Isn't it a bit difficult to get "file and line number" information?
> Personally, I liked the approach that I saw in a recent 2.1 kernel:
>
> if (code has done somthing wrong)
> *(int *)0=0;
>
> I've forgotten where it was now, but it definitely made sure the offending
> code was fixed :)

All of the rest of the GCC-familar folks out there should already know
this one :)

(from a userspace program)

#define PRINT_MESSAGE() \
fprintf(stderr, "Shouldn't be in %s;\n", __FUNCTION__)

There's also __PRETTY_FUNCTION__ which demangles C++.

I'm not really sure how to get line number (__LINE__ ??)

Hey, it works :)
G'day, eh?
- Teunis