Deutsch   English   Français   Italiano  
<87h6e91r91.fsf@nosuchdomain.example.com>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: ...!weretis.net!feeder8.news.weretis.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Keith Thompson <Keith.S.Thompson+u@gmail.com>
Newsgroups: comp.lang.c
Subject: Re: Writing own source disk
Date: Mon, 03 Jun 2024 17:33:14 -0700
Organization: None to speak of
Lines: 18
Message-ID: <87h6e91r91.fsf@nosuchdomain.example.com>
References: <v3hmha$3banl$1@dont-email.me> <87sexvm1lr.fsf@bsb.me.uk>
	<v3iu4n$3i607$1@dont-email.me> <87mso2mky5.fsf@bsb.me.uk>
	<v3k49t$3rdhi$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Date: Tue, 04 Jun 2024 02:33:15 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="90afdb6d92dd2740ec1db4216de117c0";
	logging-data="125771"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX18fprGRdBzCqphOM+s8MqU3"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
Cancel-Lock: sha1:/qSTDxiF8aCW3NEwkpVd/xMfIh8=
	sha1:gblMNTe53pN5Qhz2jP5tA5pBfCE=
Bytes: 1751

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.com
void Void(void) { Void(); } /* The recursive call of the void */