Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.c > #385499
| Path | csiph.com!news.mixmin.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:35:25 -0700 |
| Organization | None to speak of |
| Lines | 24 |
| Message-ID | <87cyox1r5e.fsf@nosuchdomain.example.com> (permalink) |
| 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> <87h6e91r91.fsf@nosuchdomain.example.com> |
| MIME-Version | 1.0 |
| Content-Type | text/plain |
| Injection-Date | Tue, 04 Jun 2024 02:35:25 +0200 (CEST) |
| Injection-Info | dont-email.me; posting-host="90afdb6d92dd2740ec1db4216de117c0"; logging-data="125771"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+gbgYOYgQLvxP3XzCnerYV" |
| User-Agent | Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) |
| Cancel-Lock | sha1:y99m6Z51vo1es4ld1RnSh50omSU= sha1:7R9eumgLeX8qKlQTDwE8R0FRu9U= |
| Xref | csiph.com comp.lang.c:385499 |
Show key headers only | View raw
Keith Thompson <Keith.S.Thompson+u@gmail.com> writes:
> 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.
I was thinking of using __FILE__ to access the source file at run time.
#embed is of course handled at compile time. It's very likely, but
still not quite guaranteed, that `#embed __FILE__` will be able to
access the source file.
--
Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
void Void(void) { Void(); } /* The recursive call of the void */
Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar
Writing own source disk Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2024-06-02 12:54 +0100
Re: Writing own source disk Ben Bacarisse <ben@bsb.me.uk> - 2024-06-02 23:17 +0100
Re: Writing own source disk Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2024-06-03 00:09 +0100
Re: Writing own source disk Lawrence D'Oliveiro <ldo@nz.invalid> - 2024-06-02 23:19 +0000
Re: Writing own source disk Ben Bacarisse <ben@bsb.me.uk> - 2024-06-03 13:11 +0100
Re: Writing own source disk Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2024-06-04 00:41 +0100
Re: Writing own source disk Ben Bacarisse <ben@bsb.me.uk> - 2024-06-04 14:40 +0100
Re: Writing own source disk Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2024-06-04 19:45 +0100
Re: Writing own source disk scott@slp53.sl.home (Scott Lurndal) - 2024-06-04 19:23 +0000
Re: Writing own source disk bart <bc@freeuk.com> - 2024-06-04 20:57 +0100
Re: Writing own source disk Mikko <mikko.levanto@iki.fi> - 2024-06-05 11:13 +0300
Re: Writing own source disk bart <bc@freeuk.com> - 2024-06-05 09:23 +0100
Re: Writing own source disk bart <bc@freeuk.com> - 2024-06-03 00:10 +0100
Re: Writing own source disk Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2024-06-03 05:16 +0100
Re: Writing own source disk Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2024-06-03 05:19 +0100
Re: Writing own source disk Ben Bacarisse <ben@bsb.me.uk> - 2024-06-03 10:31 +0100
Re: Writing own source disk bart <bc@freeuk.com> - 2024-06-03 11:01 +0100
Re: Writing own source disk Ben Bacarisse <ben@bsb.me.uk> - 2024-06-03 12:58 +0100
Re: Writing own source disk bart <bc@freeuk.com> - 2024-06-03 13:37 +0100
Re: Writing own source disk bart <bc@freeuk.com> - 2024-06-03 14:50 +0100
Re: Writing own source disk Ben Bacarisse <ben@bsb.me.uk> - 2024-06-03 14:55 +0100
Re: Writing own source disk bart <bc@freeuk.com> - 2024-06-03 15:34 +0100
Re: Writing own source disk Ben Bacarisse <ben@bsb.me.uk> - 2024-06-03 19:36 +0100
Re: Writing own source disk Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2024-06-04 00:35 +0100
Re: Writing own source disk Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2024-06-03 17:33 -0700
Re: Writing own source disk Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2024-06-03 17:35 -0700
Re: Writing own source disk David Brown <david.brown@hesbynett.no> - 2024-06-04 09:30 +0200
Re: Writing own source disk Mikko <mikko.levanto@iki.fi> - 2024-06-05 11:19 +0300
Re: Writing own source disk Lawrence D'Oliveiro <ldo@nz.invalid> - 2024-06-05 08:29 +0000
Re: Writing own source disk Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2024-06-05 11:10 -0700
Re: Writing own source disk scott@slp53.sl.home (Scott Lurndal) - 2024-06-05 18:23 +0000
Re: Writing own source disk Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2024-06-05 11:26 -0700
Re: Writing own source disk David Brown <david.brown@hesbynett.no> - 2024-06-05 21:27 +0200
Re: Writing own source disk Lawrence D'Oliveiro <ldo@nz.invalid> - 2024-06-03 23:56 +0000
Re: Writing own source disk Ben Bacarisse <ben@bsb.me.uk> - 2024-06-04 12:10 +0100
Re: Writing own source disk Lawrence D'Oliveiro <ldo@nz.invalid> - 2024-06-02 23:18 +0000
Re: Writing own source disk Michael S <already5chosen@yahoo.com> - 2024-06-03 16:04 +0300
Re: Writing own source disk Ben Bacarisse <ben@bsb.me.uk> - 2024-06-03 14:47 +0100
Re: Writing own source disk Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2024-06-04 01:18 +0100
Re: Writing own source disk Ben Bacarisse <ben@bsb.me.uk> - 2024-06-04 14:33 +0100
Re: Writing own source disk Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2024-06-04 19:41 +0100
Re: Writing own source disk Richard Harnden <richard.nospam@gmail.invalid> - 2024-06-04 21:04 +0100
Re: Writing own source disk Ben Bacarisse <ben@bsb.me.uk> - 2024-06-06 18:00 +0100
Re: Writing own source disk Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2024-06-06 20:24 +0100
Re: Writing own source disk Ben Bacarisse <ben@bsb.me.uk> - 2024-06-07 20:04 +0100
csiph-web