473,387 Members | 1,619 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

macro to control conditional compilation based on date

Anyone out there ever come across a preprocessor macro that compares an
argument value against the predefined __DATE__ macro in order to
control conditional compilation based on date.

Something along the lines of...

# define DateLaterThan(x) ...

that could be used for things like

#if DateLaterThan("Jun 15 2006")
#error The following debug code can be deleted now
#end
Would be pretty handy to be able to leave a forceful reminder in souce
code to prompt cleanup of ugly quick fixes, tempory diagnostics etc.
etc. rather than passive TODO/FIXME type comment tags.
--
comp.lang.c.moderated - moderation address: cl**@plethora.net -- you must
have an appropriate newsgroups line in your header for your mail to be seen,
or the newsgroup name in square brackets in the subject line. Sorry.
Mar 10 '06 #1
28 2600

<ri*********@my-deja.com> wrote in message
news:cl****************@plethora.net...
Anyone out there ever come across a preprocessor macro that compares an
argument value against the predefined __DATE__ macro in order to
control conditional compilation based on date.


(First post was yesterday and also to comp.lang.c.moderated , so it'll
probably show up here a week from now... ;)

Nope.

But, you "might" be able to do something similar using assert(), strcmp(),
localtime(), strftime(), and __DATE__.
Rod Pemberton
Mar 11 '06 #2
On Friday 10 March 2006 05:09, ri*********@my-deja.com opined (in
<cl****************@plethora.net>):
Anyone out there ever come across a preprocessor macro that compares
an argument value against the predefined __DATE__ macro in order to
control conditional compilation based on date.

Something along the lines of...

# define DateLaterThan(x) ...

that could be used for things like

#if DateLaterThan("Jun 15 2006")
#error The following debug code can be deleted now
#end
Would be pretty handy to be able to leave a forceful reminder in souce
code to prompt cleanup of ugly quick fixes, tempory diagnostics etc.
etc. rather than passive TODO/FIXME type comment tags.


__DATE__ is not part of standard C, and `DateLaterThan` certainly isn't
either. I'd expect that some compilers may implement the former, but
I'd be surprised if that were the case for the latter.

All this is off-topic here (only standard C is discussed). You're much
better of asking in your particular compiler's group. Note, however,
that if you change compilers sometime down the line, you're neat
solution is likely to stop working.

--
BR, Vladimir

Warp 7 -- It's a law we can live with.
--
comp.lang.c.moderated - moderation address: cl**@plethora.net -- you must
have an appropriate newsgroups line in your header for your mail to be seen,
or the newsgroup name in square brackets in the subject line. Sorry.
Apr 2 '06 #3
ri*********@my-deja.com wrote:
Anyone out there ever come across a preprocessor macro that compares an
argument value against the predefined __DATE__ macro in order to
control conditional compilation based on date.

Something along the lines of...

# define DateLaterThan(x) ...

that could be used for things like

#if DateLaterThan("Jun 15 2006")
#error The following debug code can be deleted now
#end
Would be pretty handy to be able to leave a forceful reminder in souce
code to prompt cleanup of ugly quick fixes, tempory diagnostics etc.
etc. rather than passive TODO/FIXME type comment tags.


__DATE__ is not available in standard C. Even if your compiler provides
it, and you can use it in the way you want, it's not going to be
portable. Switching to a different compiler is almost certain to break
it. If you still want to pursue this avenue, it's best asking in the
group that discusses your particular compiler.

An idea: why don't you mandate that TODO/FIXMEs are #ifdef-ed in a
manner similar to:

#if FIXME
#error "This needs fixing NOW!"
#else
/* your temporary fix */
#endif

Then, on normal days you #define (or pass as an option to the compiler)
FIXME as 0, and on special occassions as 1. If you pass it through the
compiler command line, you may also play with passing time-dependant
value and comparing against it. This is still likely to be
non-portable, though.

--
BR, Vladimir
--
comp.lang.c.moderated - moderation address: cl**@plethora.net -- you must
have an appropriate newsgroups line in your header for your mail to be seen,
or the newsgroup name in square brackets in the subject line. Sorry.
Apr 2 '06 #4
ri*********@my-deja.com wrote:
Anyone out there ever come across a preprocessor macro that compares an
argument value against the predefined __DATE__ macro in order to
control conditional compilation based on date.

Something along the lines of...

# define DateLaterThan(x) ...

that could be used for things like

#if DateLaterThan("Jun 15 2006")
#error The following debug code can be deleted now
#end

Would be pretty handy to be able to leave a forceful reminder in souce
code to prompt cleanup of ugly quick fixes, tempory diagnostics etc.
etc. rather than passive TODO/FIXME type comment tags.


The unaided preprocessor can't do it, because even though
it generates the literal corresponding to __DATE__ it's unable
to look at the contents of the literal (the literal doesn't
become a string until long after the preprocessor finishes,
and besides the preprocessor has no access to the memory that
holds the string).

Although the preprocessor won't do what you want, the
compiler itself can give some help. You could use Martin
Dickopp's trick

http://groups.google.com/group/comp....b053811e98f490

to derive values from the __DATE__ string and a similar
string you supply, and then you could use the two values
in a relational expression in a context that causes a
compile-time error if they're not in the correct relation,
such as declaring an array whose dimension is invalid if
__DATE__ is too late.

However, I'd suggest you seek other avenues. A long time
ago I, too, longed for such a construct -- I had just tracked
down and fixed a performance problem caused by a "temporary"
hack that had remained in the code through two major product
versions and into the development phase of a third. I thought
that if the compiler could have alerted us that the code needed
attention, much grief would have been avoided. After pondering
for a considerable time, though, I came to the conclusion that
the compiler's job is to translate the code it's given, not to
act as a software engineering methodology enforcer. There are
other tools to handle the latter function, and they're capable
of things that are completely outside the compiler's purview.

Also, __DATE__ is rather inflexible. You'll put in some
sort of hack and then estimate how long it'll be before you
simply must come back and do a better job, but schedules for
software development are notoriously elastic: your estimate of
the deadline is not going to be reliable. Yes, you can always
respond to the compiler's complaint by postponing the drop-dead
date, but that's just make-work -- and since Murphy never sleeps,
you can be sure the drop-dead will happen on the very night of
the Giant Rebuild before the Big Demonstration ...

If you must insert time bombs in the compilation, I'd suggest
you base them on things like product version numbers, "build for
release" flags, and the like: they are sensitive to the status
of the development rather than to the passage of time. I once
needed to hack around an error in the vendor-supplied printf()
by substituting my own version, so I had something like

#include <stdio.h>
#ifdef PLATFORM_X
#ifdef DEBUG_BUILD
/* Beta versions of printf() et al. print
* floating-point values at one-quarter
* actual magnitude. Use our own substitutes
* until Vendor X fixes this.
*/
#undef printf
#undef fprintf
#undef sprintf
#define printf fake_printf
#define fprintf fake_fprintf
#define sprintf fake_sprintf
#else
#error "Do we still need this hack?"
#endif
#endif

(The reality, of course, was more elaborate.) IMHO this sort of
thing makes more sense than date comparisons -- but it's still no
substitute for self-discipline.

--
Eric Sosman
es*****@acm-dot-org.invalid
--
comp.lang.c.moderated - moderation address: cl**@plethora.net -- you must
have an appropriate newsgroups line in your header for your mail to be seen,
or the newsgroup name in square brackets in the subject line. Sorry.
Apr 2 '06 #5
ri*********@my-deja.com wrote:
#if DateLaterThan("Jun 15 2006")
#error The following debug code can be deleted now
#end
Would be pretty handy to be able to leave a forceful reminder in souce
code to prompt cleanup of ugly quick fixes, tempory diagnostics etc.
etc. rather than passive TODO/FIXME type comment tags.


It's pretty rare that one actually wants code to become
uncompilable at a particular date. If you think there
is a need for this, it is indicative of a software
development management problem, which needs to be
addressed in some other way.
--
comp.lang.c.moderated - moderation address: cl**@plethora.net -- you must
have an appropriate newsgroups line in your header for your mail to be seen,
or the newsgroup name in square brackets in the subject line. Sorry.
Apr 2 '06 #6
<ri*********@my-deja.com> wrote in message
news:cl****************@plethora.net...
Anyone out there ever come across a preprocessor macro that compares an
argument value against the predefined __DATE__ macro in order to
control conditional compilation based on date.

Something along the lines of...

# define DateLaterThan(x) ...

that could be used for things like

#if DateLaterThan("Jun 15 2006")
#error The following debug code can be deleted now
#end


Nope.

But, you "might" be able to do something similar using assert(), strcmp(),
localtime(), strftime(), and __DATE__.
Rod Pemberton
--
comp.lang.c.moderated - moderation address: cl**@plethora.net -- you must
have an appropriate newsgroups line in your header for your mail to be seen,
or the newsgroup name in square brackets in the subject line. Sorry.
Apr 2 '06 #7
ri*********@my-deja.com wrote:
Anyone out there ever come across a preprocessor macro that compares an
argument value against the predefined __DATE__ macro in order to
control conditional compilation based on date.

Something along the lines of...

# define DateLaterThan(x) ...

that could be used for things like

#if DateLaterThan("Jun 15 2006")
#error The following debug code can be deleted now
#end


No such macro can possibly be written within the constraints of the
standard C preprocessor.
--
comp.lang.c.moderated - moderation address: cl**@plethora.net -- you must
have an appropriate newsgroups line in your header for your mail to be seen,
or the newsgroup name in square brackets in the subject line. Sorry.
Apr 2 '06 #8
Vladimir S. Oka wrote:
On Friday 10 March 2006 05:09, ri*********@my-deja.com opined (in
<cl****************@plethora.net>):

Anyone out there ever come across a preprocessor macro that compares
an argument value against the predefined __DATE__ macro in order to
control conditional compilation based on date.

Something along the lines of...

# define DateLaterThan(x) ...

that could be used for things like

#if DateLaterThan("Jun 15 2006")
#error The following debug code can be deleted now
#end
Would be pretty handy to be able to leave a forceful reminder in souce
code to prompt cleanup of ugly quick fixes, tempory diagnostics etc.
etc. rather than passive TODO/FIXME type comment tags.

__DATE__ is not part of standard C, and `DateLaterThan` certainly isn't
either. I'd expect that some compilers may implement the former, but
I'd be surprised if that were the case for the latter.

All this is off-topic here (only standard C is discussed). You're much
better of asking in your particular compiler's group. Note, however,
that if you change compilers sometime down the line, you're neat
solution is likely to stop working.


__DATE__ certainly is part of C99, quoting from 6.10.8p1:

__DATE__ The date of translation of the preprocessing translation

unit: a character string literal of the form "Mmm dd yyyy",
where the names of the months are the same as those
generated by the asctime function, and the first character
of dd is a space character if the value is less than 10. If
the date of translation is not available, an
implementation-defined valid date shall be supplied.
Apr 2 '06 #9
Marc Thrun <Te********@gmx.de> writes:
Vladimir S. Oka wrote:
On Friday 10 March 2006 05:09, ri*********@my-deja.com opined (in
<cl****************@plethora.net>):
Anyone out there ever come across a preprocessor macro that compares
an argument value against the predefined __DATE__ macro in order to
control conditional compilation based on date.

Something along the lines of...

# define DateLaterThan(x) ...

that could be used for things like

#if DateLaterThan("Jun 15 2006")
#error The following debug code can be deleted now
#end
Would be pretty handy to be able to leave a forceful reminder in souce
code to prompt cleanup of ugly quick fixes, tempory diagnostics etc.
etc. rather than passive TODO/FIXME type comment tags.

__DATE__ is not part of standard C, and `DateLaterThan` certainly
isn't
either. I'd expect that some compilers may implement the former, but
I'd be surprised if that were the case for the latter.
All this is off-topic here (only standard C is discussed). You're
much
better of asking in your particular compiler's group. Note, however,
that if you change compilers sometime down the line, you're neat
solution is likely to stop working.


__DATE__ certainly is part of C99, quoting from 6.10.8p1:

__DATE__ The date of translation of the preprocessing translation
unit: a character string literal of the form "Mmm dd yyyy",
where the names of the months are the same as those
generated by the asctime function, and the first character
of dd is a space character if the value is less than 10. If
the date of translation is not available, an
implementation-defined valid date shall be supplied.


It's in my draft copy of C89, as well. Guaranteed to have a suitable
value, even when the date is not available.

--
Micah J. Cowan
Programmer, musician, typesetting enthusiast, gamer...
http://micah.cowan.name/
Apr 2 '06 #10
Micah Cowan opined:
Marc Thrun <Te********@gmx.de> writes:
Vladimir S. Oka wrote:
> On Friday 10 March 2006 05:09, ri*********@my-deja.com opined (in
> <cl****************@plethora.net>):
>
>>Anyone out there ever come across a preprocessor macro that
>>compares an argument value against the predefined __DATE__ macro
>>in order to control conditional compilation based on date.
>>
>>Something along the lines of...
>>
>> # define DateLaterThan(x) ...
>>
>>that could be used for things like
>>
>> #if DateLaterThan("Jun 15 2006")
>> #error The following debug code can be deleted now
>> #end
>>
>>
>>Would be pretty handy to be able to leave a forceful reminder in
>>souce code to prompt cleanup of ugly quick fixes, tempory
>>diagnostics etc.
>>etc. rather than passive TODO/FIXME type comment tags.
> __DATE__ is not part of standard C, and `DateLaterThan` certainly
> isn't
> either. I'd expect that some compilers may implement the former,
> but I'd be surprised if that were the case for the latter.
> All this is off-topic here (only standard C is discussed). You're
> much
> better of asking in your particular compiler's group. Note,
> however, that if you change compilers sometime down the line,
> you're neat solution is likely to stop working.
>


__DATE__ certainly is part of C99, quoting from 6.10.8p1:

__DATE__ The date of translation of the preprocessing
translation
unit: a character string literal of the form "Mmm dd yyyy",
where the names of the months are the same as those
generated by the asctime function, and the first
character of dd is a space character if the value is
less than 10. If the date of translation is not
available, an implementation-defined valid date shall
be supplied.


It's in my draft copy of C89, as well. Guaranteed to have a suitable
value, even when the date is not available.


It's my silly assumption that the Standard would actually have the two
underscores consecutive. As it turns out, they've split them with a
blank to emphasise there's two. That, of course, foils any attempt to
search for `__DATE__`, as it's `_ _DATE_ _`.

I apologise. I should have looked more carefully (I normally don't use
those macros).
--
We cannot command nature except by obeying her.
-- Sir Francis Bacon

<http://clc-wiki.net/wiki/Introduction_to_comp.lang.c>

Apr 3 '06 #11
"Vladimir S. Oka" wrote:
.... snip ...
It's my silly assumption that the Standard would actually have the
two underscores consecutive. As it turns out, they've split them
with a blank to emphasise there's two. That, of course, foils any
attempt to search for `__DATE__`, as it's `_ _DATE_ _`.


Look again. At least in N1124.pdf that is not so. However your
fonts may be displaying the underline as something that shows blank
space between instances.

--
"I have a creative mind. You (singular) are eccentric.
He is insane. We are losing sight of reality.
You (plural) are smoking crack. They are certifiable."
Declension of verbs, per Lewin Edwards
Apr 3 '06 #12
CBFalconer <cb********@yahoo.com> writes:
"Vladimir S. Oka" wrote:

... snip ...

It's my silly assumption that the Standard would actually have the
two underscores consecutive. As it turns out, they've split them
with a blank to emphasise there's two. That, of course, foils any
attempt to search for `__DATE__`, as it's `_ _DATE_ _`.


Look again. At least in N1124.pdf that is not so. However your
fonts may be displaying the underline as something that shows blank
space between instances.


No, it is so. Try doing a search of __DATE__ on that page. At least,
xpdf won't find it.

<OT>
I don't think they actually "split them with a blank" per se. I'm not
going to bother actually looking into the nuts and bolts, but unless
they specifically tagged the content, or otherwise gave specific clues
about the nature of the textual content, there's usually not a clean
mapping from PDF content to plain text (which is necessary for
performing searches). Often, a heuristic is applied to try to figure
out where spaces are (since they pretty much never result from an
actual space character). Often, actual location is ignored, and what
gets looked at is what text appears atomically in a single
text-writing operation.
</OT>

Interestingly enough, a search for "_" (the underscore) in xpdf on
that page only seems to find the first character of each of those
predefined macros in 6.10.7.

--
Micah J. Cowan
Programmer, musician, typesetting enthusiast, gamer...
http://micah.cowan.name/
Apr 3 '06 #13
Micah Cowan opined:
CBFalconer <cb********@yahoo.com> writes:
"Vladimir S. Oka" wrote:
> ... snip ...
>
> It's my silly assumption that the Standard would actually have the
> two underscores consecutive. As it turns out, they've split them
> with a blank to emphasise there's two. That, of course, foils any
> attempt to search for `__DATE__`, as it's `_ _DATE_ _`.


Look again. At least in N1124.pdf that is not so. However your
fonts may be displaying the underline as something that shows blank
space between instances.


No, it is so. Try doing a search of __DATE__ on that page. At least,
xpdf won't find it.


Nor will Acrobat Reader for Linux (v7.0.1 on SUSE 10.0).
<OT>
I don't think they actually "split them with a blank" per se. I'm not
going to bother actually looking into the nuts and bolts, but unless


I can't be bother either, but at least now I know what to search for
when I want to find a double underscore in it.

--
Just remember: when you go to court, you are trusting your fate to
twelve people that weren't smart enough to get out of jury duty!

<http://clc-wiki.net/wiki/Introduction_to_comp.lang.c>

Apr 3 '06 #14
On Mon, 03 Apr 2006 18:50:42 +0100, "Vladimir S. Oka"
<no****@btopenworld.com> wrote:
Micah Cowan opined:
CBFalconer <cb********@yahoo.com> writes:
"Vladimir S. Oka" wrote:
>
... snip ...
>
> It's my silly assumption that the Standard would actually have the
> two underscores consecutive. As it turns out, they've split them
> with a blank to emphasise there's two. That, of course, foils any
> attempt to search for `__DATE__`, as it's `_ _DATE_ _`.

Look again. At least in N1124.pdf that is not so. However your
fonts may be displaying the underline as something that shows blank
space between instances.


No, it is so. Try doing a search of __DATE__ on that page. At least,
xpdf won't find it.


Nor will Acrobat Reader for Linux (v7.0.1 on SUSE 10.0).
<OT>
I don't think they actually "split them with a blank" per se. I'm not
going to bother actually looking into the nuts and bolts, but unless


I can't be bother either, but at least now I know what to search for
when I want to find a double underscore in it.


This is strange. My copy of the C99 pdf, as interpreted by Acrobat
5.1.0, shows a leading double underscore, and a trailing underscore,
space, underscore for __FILE__, __LINE__, and __func__ in their first
occurrence, 7.2.1.1. Copy and paste into a hex editor confirms this.

--
Al Balmer
Sun City, AZ
Apr 3 '06 #15
Al Balmer wrote:
My copy of the C99 pdf, as interpreted by Acrobat
5.1.0, shows a leading double underscore, and a trailing underscore,
space, underscore for __FILE__, __LINE__, and __func__ in their first
occurrence, 7.2.1.1. Copy and paste into a hex editor confirms this.


Same here.
This is my copy and paste of C99 from acrobat into my newsreader:
__FILE_ _ and __LINE_ _
This is copied and pasted from the text version of n869:
__FILE__ and __LINE__

I like text files.

--
pete
Apr 3 '06 #16
Micah Cowan wrote:

CBFalconer <cb********@yahoo.com> writes:
"Vladimir S. Oka" wrote:

... snip ...

It's my silly assumption that the Standard would actually have the
two underscores consecutive. As it turns out, they've split them
with a blank to emphasise there's two. That, of course, foils any
attempt to search for `__DATE__`, as it's `_ _DATE_ _`.


Look again. At least in N1124.pdf that is not so. However your
fonts may be displaying the underline as something that shows blank
space between instances.


No, it is so. Try doing a search of __DATE__ on that page. At least,
xpdf won't find it.


Exactly what I did - I loaded n1124.pdf into acroread, and
searched. I suspect your use of 'page' implies something
different.

--
"If you want to post a followup via groups.google.com, don't use
the broken "Reply" link at the bottom of the article. Click on
"show options" at the top of the article, then click on the
"Reply" at the bottom of the article headers." - Keith Thompson
More details at: <http://cfaj.freeshell.org/google/>
Also see <http://www.safalra.com/special/googlegroupsreply/>
Apr 3 '06 #17
pete opined:
Al Balmer wrote:
My copy of the C99 pdf, as interpreted by Acrobat
5.1.0, shows a leading double underscore, and a trailing underscore,
space, underscore for __FILE__, __LINE__, and __func__ in their
first occurrence, 7.2.1.1. Copy and paste into a hex editor confirms
this.


Same here.
This is my copy and paste of C99 from acrobat into my newsreader:
__FILE_ _ and __LINE_ _
This is copied and pasted from the text version of n869:
__FILE__ and __LINE__

I like text files.


Copy/paste from my N1124.pdf as read by Adobe Reader 7.0.1 for Linux:

_ _DATE_ _

Weird...

--
Receiving a million dollars tax free will make you feel better than
being flat broke and having a stomach ache.
-- Dolph Sharp

<http://clc-wiki.net/wiki/Introduction_to_comp.lang.c>

Apr 3 '06 #18
On Mon, 03 Apr 2006 18:22:58 GMT, in comp.lang.c , Al Balmer
<al******@att.net> wrote:
On Mon, 03 Apr 2006 18:50:42 +0100, "Vladimir S. Oka"
<no****@btopenworld.com> wrote:
Micah Cowan opined:
I don't think they actually "split them with a blank" per se. I'm not
going to bother actually looking into the nuts and bolts, but unless


I can't be bother either, but at least now I know what to search for
when I want to find a double underscore in it.


occurrence, 7.2.1.1. Copy and paste into a hex editor confirms this.


7.2.1 mentions "__FILE_ _ and __LINE_ _" but visually, it appears as
"_ _FILE_ _ and _ _LINE_ _"

FWIW 6.10.8 of the ISO Standard has
"_ _DATE_ _ " in both visual and searchable values.

I reckon its an artefact of the justifying typsetter engine in
Acrobat..



Mark McIntyre
--
"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it."
--Brian Kernighan
Apr 3 '06 #19
CBFalconer <cb********@yahoo.com> writes:
Micah Cowan wrote:

CBFalconer <cb********@yahoo.com> writes:
"Vladimir S. Oka" wrote:

... snip ...

It's my silly assumption that the Standard would actually have the
two underscores consecutive. As it turns out, they've split them
with a blank to emphasise there's two. That, of course, foils any
attempt to search for `__DATE__`, as it's `_ _DATE_ _`.

Look again. At least in N1124.pdf that is not so. However your
fonts may be displaying the underline as something that shows blank
space between instances.


No, it is so. Try doing a search of __DATE__ on that page. At least,
xpdf won't find it.


Exactly what I did - I loaded n1124.pdf into acroread, and
searched. I suspect your use of 'page' implies something
different.


Nope. Must be differences in our readers. I'm using xpdf, you're using
acroread.

But Vlad seems to be using acroread (7) as well. Maybe they mucked
that up since your version?

Huh. Wierd.

--
Micah J. Cowan
Programmer, musician, typesetting enthusiast, gamer...
http://micah.cowan.name/
Apr 3 '06 #20

In article <87************@mcowan.barracudanetworks.com>, Micah Cowan <mi***@cowan.name> writes:
CBFalconer <cb********@yahoo.com> writes:
Micah Cowan wrote:

CBFalconer <cb********@yahoo.com> writes:
> "Vladimir S. Oka" wrote:
>>
>> It's my silly assumption that the Standard would actually have the
>> two underscores consecutive. As it turns out, they've split them
>> with a blank to emphasise there's two. That, of course, foils any
>> attempt to search for `__DATE__`, as it's `_ _DATE_ _`.
>
> Look again. At least in N1124.pdf that is not so. However your
> fonts may be displaying the underline as something that shows blank
> space between instances.

No, it is so. Try doing a search of __DATE__ on that page. At least,
xpdf won't find it.


Exactly what I did - I loaded n1124.pdf into acroread, and
searched. I suspect your use of 'page' implies something
different.


Nope. Must be differences in our readers. I'm using xpdf, you're using
acroread.

But Vlad seems to be using acroread (7) as well. Maybe they mucked
that up since your version?

Huh. Wierd.


This was discussed at least as recently as last December, when Larry
Jones noted that at least some versions of the PDF include "a very
think space between the two underscores" for readability purposes.[1]

It's possible that different readers - including different versions
of Acrobeast Reaver - handle that "very thin space" character
differently for searching and copying purposes. Some may treat it as
a space when reducing to ASCII, and others may treat it as
typographical leading[2] and ignore it.

It's also possible that ANSI has played around with the PDF contents
in ways that don't alter the wording of the standard, so that
different versions of the document exist. Though my copy of ISO/IEC
9899-1999(E), ANSI PDF version, downloaded 2005-10-06 (the ANSI store
inserts purchase information onto the cover page of downloaded PDFs)
matches what Al, Pete, and Mark reported.

My copy of the N1124 PDF, on the other hand, doesn't find "__"
anywhere - all the double-underscores have the thin-leading insertion.
1. http://groups.google.com/group/comp....e222522db1d348
2. That's "leading" as in the soft metal, in other words, not as in
"coming in front".

--
Michael Wojcik mi************@microfocus.com

When most of what you do is a bit of a fraud, the word "profession"
starts to look like the Berlin Wall. -- Tawada Yoko (t. M. Mitsutani)
Apr 4 '06 #21
Michael Wojcik wrote:

In article <87************@mcowan.barracudanetworks.com>, Micah Cowan <mi***@cowan.name> writes:
CBFalconer <cb********@yahoo.com> writes:
Micah Cowan wrote:
>
> CBFalconer <cb********@yahoo.com> writes:
>> "Vladimir S. Oka" wrote:
>>>
>>> It's my silly assumption that the Standard would actually have the
>>> two underscores consecutive. As it turns out, they've split them
>>> with a blank to emphasise there's two. That, of course, foils any
>>> attempt to search for `__DATE__`, as it's `_ _DATE_ _`.
>>
>> Look again. At least in N1124.pdf that is not so. However your
>> fonts may be displaying the underline as something that shows blank
>> space between instances.
>
> No, it is so. Try doing a search of __DATE__ on that page. At least,
> xpdf won't find it.

Exactly what I did - I loaded n1124.pdf into acroread, and
searched. I suspect your use of 'page' implies something
different.


Nope. Must be differences in our readers. I'm using xpdf, you're using
acroread.

But Vlad seems to be using acroread (7) as well. Maybe they mucked
that up since your version?

Huh. Wierd.


This was discussed at least as recently as last December, when Larry
Jones noted that at least some versions of the PDF include "a very
think space between the two underscores" for readability purposes.[1]

It's possible that different readers - including different versions
of Acrobeast Reaver - handle that "very thin space" character
differently for searching and copying purposes. Some may treat it as
a space when reducing to ASCII, and others may treat it as
typographical leading[2] and ignore it.

It's also possible that ANSI has played around with the PDF contents
in ways that don't alter the wording of the standard, so that
different versions of the document exist. Though my copy of ISO/IEC
9899-1999(E), ANSI PDF version, downloaded 2005-10-06 (the ANSI store
inserts purchase information onto the cover page of downloaded PDFs)
matches what Al, Pete, and Mark reported.

My copy of the N1124 PDF, on the other hand, doesn't find "__"
anywhere - all the double-underscores have the thin-leading insertion.


I downloaded mine last June 5th, and acrowhatzit 4.05 found the
double leading underscores without problem. However they display
with blank space between them, leading and trailing.

However I just tried foxrd on the same file, with the same search.
Not found!

--
"If you want to post a followup via groups.google.com, don't use
the broken "Reply" link at the bottom of the article. Click on
"show options" at the top of the article, then click on the
"Reply" at the bottom of the article headers." - Keith Thompson
More details at: <http://cfaj.freeshell.org/google/>
Also see <http://www.safalra.com/special/googlegroupsreply/>
Apr 4 '06 #22
mw*****@newsguy.com (Michael Wojcik) wrote:
It's possible that different readers - including different versions
of Acrobeast Reaver - handle that "very thin space" character
differently for searching and copying purposes. Some may treat it as
a space when reducing to ASCII, and others may treat it as
typographical leading[2] and ignore it. 2. That's "leading" as in the soft metal, in other words, not as in
"coming in front".


No, that's "spacing" as in the soft metal. "Leading" is between lines.

Richard
Apr 5 '06 #23
On Wed, 05 Apr 2006 12:10:30 GMT, in comp.lang.c ,
rl*@hoekstra-uitgeverij.nl (Richard Bos) wrote:
mw*****@newsguy.com (Michael Wojcik) wrote:
It's possible that different readers - including different versions
of Acrobeast Reaver - handle that "very thin space" character
differently for searching and copying purposes. Some may treat it as
a space when reducing to ASCII, and others may treat it as
typographical leading[2] and ignore it.
2. That's "leading" as in the soft metal, in other words, not as in
"coming in front".


No, that's "spacing" as in the soft metal.


The word you're searching for is "kerning".
"Leading" is between lines.


It is however still pronounced "ledding".

Mark McIntyre
--
"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it."
--Brian Kernighan
Apr 5 '06 #24
Mark McIntyre <ma**********@spamcop.net> wrote:
On Wed, 05 Apr 2006 12:10:30 GMT, in comp.lang.c ,
rl*@hoekstra-uitgeverij.nl (Richard Bos) wrote:
mw*****@newsguy.com (Michael Wojcik) wrote:
It's possible that different readers - including different versions
of Acrobeast Reaver - handle that "very thin space" character
differently for searching and copying purposes. Some may treat it as
a space when reducing to ASCII, and others may treat it as
typographical leading[2] and ignore it.

2. That's "leading" as in the soft metal, in other words, not as in
"coming in front".


No, that's "spacing" as in the soft metal.


The word you're searching for is "kerning".


Kerning is a special case of spacing. Kerning is spacing inserted (or
removed; in olden days, that was obviously impossible, so letters had to
be designed with optimally kerned width, and the few couples where less
would've been better ignored) to make the space between letters
optically, as opposed to geometrically, even.
Spacing in general is done for all kind of reasons; to set a table, or
to make a word s t a n d o u t , for example. Or, as in this case, to
make sure that two glyphs don't run into one another.
"Leading" is between lines.


It is however still pronounced "ledding".


Certainly.

Richard
Apr 6 '06 #25
ri*********@my-deja.com wrote:
Anyone out there ever come across a preprocessor macro that compares an
argument value against the predefined __DATE__ macro in order to
control conditional compilation based on date.

Something along the lines of...

# define DateLaterThan(x) ...

that could be used for things like

#if DateLaterThan("Jun 15 2006")
#error The following debug code can be deleted now
#end
Would be pretty handy to be able to leave a forceful reminder in souce
code to prompt cleanup of ugly quick fixes, tempory diagnostics etc.
etc. rather than passive TODO/FIXME type comment tags.
--
comp.lang.c.moderated - moderation address: cl**@plethora.net -- you must
have an appropriate newsgroups line in your header for your mail to be seen,
or the newsgroup name in square brackets in the subject line. Sorry.


I've seen this accomplished through clever use of the makefile/make
utility.
--
comp.lang.c.moderated - moderation address: cl**@plethora.net -- you must
have an appropriate newsgroups line in your header for your mail to be seen,
or the newsgroup name in square brackets in the subject line. Sorry.
Apr 6 '06 #26
rl*@hoekstra-uitgeverij.nl (Richard Bos) writes:
Mark McIntyre <ma**********@spamcop.net> wrote:
On Wed, 05 Apr 2006 12:10:30 GMT, in comp.lang.c ,
rl*@hoekstra-uitgeverij.nl (Richard Bos) wrote:
mw*****@newsguy.com (Michael Wojcik) wrote:

> It's possible that different readers - including different versions
> of Acrobeast Reaver - handle that "very thin space" character
> differently for searching and copying purposes. Some may treat it as
> a space when reducing to ASCII, and others may treat it as
> typographical leading[2] and ignore it.

> 2. That's "leading" as in the soft metal, in other words, not as in
> "coming in front".

No, that's "spacing" as in the soft metal.


The word you're searching for is "kerning".


Kerning is a special case of spacing. Kerning is spacing inserted (or
removed; in olden days, that was obviously impossible, so letters had to
be designed with optimally kerned width, and the few couples where less
would've been better ignored) to make the space between letters
optically, as opposed to geometrically, even.
Spacing in general is done for all kind of reasons; to set a table, or
to make a word s t a n d o u t , for example. Or, as in this case, to
make sure that two glyphs don't run into one another.


(Dare I continue this off-topic thread? But it's one of my favorite
topics...)

Kerning /was/ done with metal type, by notching the metal. For
instance, in a "T", the arms would sometimes be made to stick out a
bit from the metal, so that the side was not straight, and a lowercase
a (for example) could be made to sit closer inside a bit. Of course,
most (but not all) automated typesetting machines didn't handle type
of this sort. The bit of the T that stuck out was called a "kern".

Of course, I'm sure it was much easier to achieve with the advent of
photographic typesetting. For my part, I'm happy to have grown up
after digital typesetting has matured past a lot of its early
quirks. Though I have strong feelings regarding the lack of support
for quality typesetting features in most available APIs and OSses.

--
Micah J. Cowan
Programmer, musician, typesetting enthusiast, gamer...
http://micah.cowan.name/
Apr 6 '06 #27

In article <44****************@news.xs4all.nl>, rl*@hoekstra-uitgeverij.nl (Richard Bos) writes:
mw*****@newsguy.com (Michael Wojcik) wrote:
Some may treat it as
a space when reducing to ASCII, and others may treat it as
typographical leading[2] and ignore it.

2. That's "leading" as in the soft metal, in other words, not as in
"coming in front".


No, that's "spacing" as in the soft metal. "Leading" is between lines.


Thanks for the correction; I clearly need to review my typography.

Anyway, the main point remains that it's possible some PDF readers
will treat that "very thin space" as typographical spacing and not
as a space character.

--
Michael Wojcik mi************@microfocus.com
Apr 7 '06 #28
On 06 Apr 2006 07:58:04 GMT, "Ivanna Pee" <fr***@Infectedmail.com>
wrote:
ri*********@my-deja.com wrote:
Anyone out there ever come across a preprocessor macro that compares an
argument value against the predefined __DATE__ macro in order to
control conditional compilation based on date.

Something along the lines of...

# define DateLaterThan(x) ...

that could be used for things like

#if DateLaterThan("Jun 15 2006")
#error The following debug code can be deleted now
#end
Would be pretty handy to be able to leave a forceful reminder in souce
code to prompt cleanup of ugly quick fixes, tempory diagnostics etc.
etc. rather than passive TODO/FIXME type comment tags.
--
comp.lang.c.moderated - moderation address: cl**@plethora.net -- you must
have an appropriate newsgroups line in your header for your mail to be seen,
or the newsgroup name in square brackets in the subject line. Sorry.


I've seen this accomplished through clever use of the makefile/make
utility.


You've seen *what* accomplished? Putting the newsgroup name in square
brackets? If you must post from Google, at least learn how to do it
properly. Eliding signature blocks would be a start.

--
Al Balmer
Sun City, AZ
--
comp.lang.c.moderated - moderation address: cl**@plethora.net -- you must
have an appropriate newsgroups line in your header for your mail to be seen,
or the newsgroup name in square brackets in the subject line. Sorry.
Apr 16 '06 #29

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Roman Mashak | last post by:
Hello, All! I would like to use this macro to substitute type of variable, but it doesn't work by now: typedef enum table_type_e { INT, FLOAT, DOUBLE } table_type_t;
6
by: Roman Mashak | last post by:
Hello, All! I'm trying to set up macro: .... int main(int argc, char *argv, char *envp) { .... if ( argc > 1 ) { if ( strcmp(argv, "-d") == 0 ) {
17
by: ethan | last post by:
Hi All, How to write a macro with variable length of argument? For example, if i need a macro to check return value of printf. #define PRINTF_ESC(x, ...) if(printf(x, ...) == 10) goto end; ...
1
by: lavu | last post by:
Is there any way to specify a different executable name for my project based on value that I have set in my conditional compilation constant. For eg: If I have FIRST specified in my conditional...
20
by: Srinivas Mudireddy | last post by:
Hi, I am facing a problem with trying to conditionally compile inside a macro. I have a macro #define SET_VAL(x, y) ((x) = *(y)) But the problem is y can be NULL in which case I want to set...
10
by: Dave | last post by:
I'm a C++ programmer of many years, trying to get my feet wet in C#. I have a question about conditional compilation. In C++, I would sometimes define a constant in an include file, and then...
1
by: Sagaert Johan | last post by:
Hi Is there a constant i could use to force conditional compilation based on whether i compile for CF or the Full NET framework ? Johan
2
by: utab | last post by:
Dear all, I was looking at a simple code on an exercise question. In the code, there is a conditional inclusion dependent on __GNUC__ #include <algorithm> #include <iomanip> #ifndef __GNUC__...
33
by: Peng Yu | last post by:
Hi, __PRETTY_FUNCTION__ is a macro that gives function name, etc. I'm wondering if there is a macro to get the class name inside a member function. Thanks, Peng
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.