Re: Writing own source disk

Liste des GroupesRevenir à l c 
Sujet : Re: Writing own source disk
De : mikko.levanto (at) *nospam* iki.fi (Mikko)
Groupes : comp.lang.c
Date : 05. Jun 2024, 09:19:36
Autres entêtes
Organisation : -
Message-ID : <v3p72o$t16n$1@dont-email.me>
References : 1 2 3 4 5 6 7
User-Agent : Unison/2.2
On 2024-06-04 00:35:25 +0000, Keith Thompson said:

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.
An operating system might refuse to open an already opened file.
There is no good reason to refuse when all accesses are for read-only
but a supid operating system might think otherwise.
--
Mikko

Date Sujet#  Auteur
4 Jun 24 * Re: Writing own source disk8Keith Thompson
4 Jun 24 `- Re: Writing own source disk7Keith Thompson

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal