Re: [PATCH] BUG preserve registers

H. Peter Anvin
2002-02-10T07:13:44Z

Linus Torvalds wrote:

>
> __BASE_FILE__ is not useful.
>
> Remember: when we have a BUG in a header file, we need to get the HEADER
> file, not the base file.
>
> __BASE_FILE__ only works for .c files.
>
> And .c files aren't the problem anyway (ie if we didn't have BUG()
> statements in header files, we wouldn't have problems anyway).
>

What we'd really like is something like:

/* foo.h */
#ifndef _FOO_H
#define _FOO_H
#define _FILE_REF __fileref_foo_h

[...]

#undef _FILE_REF
#endif /* _FOO_H */

... and have an automatically generated library (.a file) with all these
strings that could be pulled in as necessary -- but only one instance of
each. However, doing this without compiler support seems ugly in the
extreme.

Of course, if the linker would fold strings for us then it would be a
helluva lot easier...

-hpa