Sujet : Re: Writing own source disk
De : Keith.S.Thompson+u (at) *nospam* gmail.com (Keith Thompson)
Groupes : comp.lang.cDate : 04. Jun 2024, 01:33:14
Autres entêtes
Organisation : None to speak of
Message-ID : <87h6e91r91.fsf@nosuchdomain.example.com>
References : 1 2 3 4 5
User-Agent : Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
bart <
bc@freeuk.com> writes:
[...]
I assume you can use __FILE__ with #embed? (I can do that with my
version of it).
Yes, but not reliably.
__FILE__ expands to "The presumed name of the current source file (a
character string literal)". That's rather vague.
With gcc and clang, it expands to the file name argument given to the
compiler, or to the argument of the #include directive. The running
program may or may not be able to access the source file using that
name. The source file might not even exist when the program runs.
-- Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.comvoid Void(void) { Void(); } /* The recursive call of the void */