Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c > #111333 > unrolled thread

what does # mean?

Started byT <T@invalid.invalid>
First post2017-06-03 00:39 -0700
Last post2017-06-05 03:00 -0700
Articles 18 on this page of 38 — 11 participants

Back to article view | Back to comp.lang.c


Contents

  what does # mean? T <T@invalid.invalid> - 2017-06-03 00:39 -0700
    Re: what does # mean? GOTHIER Nathan <nathan.gothier@gmail.com> - 2017-06-03 10:06 +0200
      Re: what does # mean? T <T@invalid.invalid> - 2017-06-03 01:25 -0700
        Re: what does # mean? Leon Taylor <leontaylor476@gmail.com> - 2017-06-03 03:41 -0700
        Re: what does # mean? Keith Thompson <kst-u@mib.org> - 2017-06-03 09:03 -0700
          Re: what does # mean? bartc <bc@freeuk.com> - 2017-06-03 17:11 +0100
            Re: what does # mean? T <T@invalid.invalid> - 2017-06-03 13:56 -0700
    Re: what does # mean? Jerry Stuckle <jstucklex@attglobal.net> - 2017-06-03 09:24 -0400
      Re: what does # mean? T <T@invalid.invalid> - 2017-06-03 13:52 -0700
      Re: what does # mean? T <T@invalid.invalid> - 2017-06-03 13:55 -0700
        Re: what does # mean? Jerry Stuckle <jstucklex@attglobal.net> - 2017-06-04 18:19 -0400
          Re: what does # mean? T <T@invalid.invalid> - 2017-06-05 01:54 -0700
    Re: what does # mean? Keith Thompson <kst-u@mib.org> - 2017-06-03 09:05 -0700
      Re: what does # mean? gazelle@shell.xmission.com (Kenny McCormack) - 2017-06-03 16:18 +0000
        Re: what does # mean? GOTHIER Nathan <nathan.gothier@gmail.com> - 2017-06-03 18:22 +0200
          Re: what does # mean? gazelle@shell.xmission.com (Kenny McCormack) - 2017-06-03 16:30 +0000
            Re: what does # mean? GOTHIER Nathan <nathan.gothier@gmail.com> - 2017-06-03 19:18 +0200
              Re: what does # mean? gazelle@shell.xmission.com (Kenny McCormack) - 2017-06-03 18:03 +0000
      Re: what does # mean? T <T@invalid.invalid> - 2017-06-03 13:59 -0700
        Re: what does # mean? GOTHIER Nathan <nathan.gothier@gmail.com> - 2017-06-03 23:30 +0200
          Re: what does # mean? T <T@invalid.invalid> - 2017-06-03 14:35 -0700
            Re: what does # mean? GOTHIER Nathan <nathan.gothier@gmail.com> - 2017-06-03 23:55 +0200
              Re: what does # mean? T <T@invalid.invalid> - 2017-06-03 15:30 -0700
                Re: what does # mean? GOTHIER Nathan <nathan.gothier@gmail.com> - 2017-06-04 00:36 +0200
                  Re: what does # mean? T <T@invalid.invalid> - 2017-06-03 16:12 -0700
                    Re: what does # mean? Ian Collins <ian-news@hotmail.com> - 2017-06-04 11:17 +1200
                      Re: what does # mean? GOTHIER Nathan <nathan.gothier@gmail.com> - 2017-06-04 01:23 +0200
        Re: what does # mean? Keith Thompson <kst-u@mib.org> - 2017-06-03 19:15 -0700
          Re: what does # mean? T <T@invalid.invalid> - 2017-06-03 19:27 -0700
            Re: what does # mean? Manfred <noname@invalid.add> - 2017-06-04 19:09 +0200
              Re: what does # mean? T <T@invalid.invalid> - 2017-06-05 01:56 -0700
            Re: what does # mean? Keith Thompson <kst-u@mib.org> - 2017-06-04 13:51 -0700
              Re: what does # mean? T <T@invalid.invalid> - 2017-06-05 01:57 -0700
    Re: what does # mean? James Kuyper <jameskuyper@verizon.net> - 2017-06-03 23:08 -0400
      Re: what does # mean? T <T@invalid.invalid> - 2017-06-03 20:53 -0700
        Re: what does # mean? John Bode <jfbode1029@gmail.com> - 2017-06-05 12:44 -0700
          Re: what does # mean? T <T@invalid.invalid> - 2017-06-05 14:52 -0700
    Re: what does # mean? T <T@invalid.invalid> - 2017-06-05 03:00 -0700

Page 2 of 2 — ← Prev page 1 [2]


#111426

FromT <T@invalid.invalid>
Date2017-06-03 14:35 -0700
Message-ID<ogv9ri$ppf$1@dont-email.me>
In reply to#111425
On 06/03/2017 02:30 PM, GOTHIER Nathan wrote:
> On Sat, 3 Jun 2017 13:59:17 -0700
> T <T@invalid.invalid> wrote:
> 
>> I am not trying to learn C.  I am trying to find
>> a missing dependency.  I can read Perl, Pascal, Modula2.
>> I am lost when it comes to C.  Hopefully, when I
>> find what I am looking for, I won't have to read C
>> again for many years.  When it comes to C, there are
>> folks far better at it than me and I will leave it to them.
> 
> Some animals do the same with females. When they're done they get away to other
> stuffs... possibly other females. :o)
> 

Man there are a lot of crabby people on this group!

[toc] | [prev] | [next] | [standalone]


#111428

FromGOTHIER Nathan <nathan.gothier@gmail.com>
Date2017-06-03 23:55 +0200
Message-ID<20170603235543.537680bfab4b7e53822dd752@gmail.com>
In reply to#111426
On Sat, 3 Jun 2017 14:35:02 -0700
T <T@invalid.invalid> wrote:

> Man there are a lot of crabby people on this group!

I wouldn't be so abrasive if you weren't that kind of animal. Now you can go
away and forget C forever... upto the next time you would feint to learn C.

[toc] | [prev] | [next] | [standalone]


#111436

FromT <T@invalid.invalid>
Date2017-06-03 15:30 -0700
Message-ID<ogvd3g$7ci$1@dont-email.me>
In reply to#111428
On 06/03/2017 02:55 PM, GOTHIER Nathan wrote:
> On Sat, 3 Jun 2017 14:35:02 -0700
> T <T@invalid.invalid> wrote:
> 
>> Man there are a lot of crabby people on this group!
> 
> I wouldn't be so abrasive if you weren't that kind of animal. Now you can go
> away and forget C forever... upto the next time you would feint to learn C.
> 

What a jerk.  I asked a simple question.  NO ONE
forced you to read it.  Are you tied to
a chair being forced to read my posts?  Do we
need to call 911?  Have you admitted where
you buried Jimmy Hoffa yet?

I am not trying to learn C.  I am trying to find
a dependency in my system.  `#` in all the other
languages I know is a comment.  So I was skipping
reading the code.

Fortunately, nicer folks answered me.

[toc] | [prev] | [next] | [standalone]


#111439

FromGOTHIER Nathan <nathan.gothier@gmail.com>
Date2017-06-04 00:36 +0200
Message-ID<20170604003608.2684a32088e3bde6a2d7f1b9@gmail.com>
In reply to#111436
On Sat, 3 Jun 2017 15:30:26 -0700
T <T@invalid.invalid> wrote:

> I am not trying to learn C.  I am trying to find
> a dependency in my system.  `#` in all the other
> languages I know is a comment.  So I was skipping
> reading the code.

I would recommend you to ask relevant questions to your system support.

There's no Red Hat support here, only C programmers discussing C features.

For a company that worth over $16 billions at the NASDAQ, it would be very
dubious to not be able to get a reliable support.

PS: The same could be said for Microsoft.

[toc] | [prev] | [next] | [standalone]


#111440

FromT <T@invalid.invalid>
Date2017-06-03 16:12 -0700
Message-ID<ogvfii$dl4$1@dont-email.me>
In reply to#111439
On 06/03/2017 03:36 PM, GOTHIER Nathan wrote:
> On Sat, 3 Jun 2017 15:30:26 -0700
> T <T@invalid.invalid> wrote:
> 
>> I am not trying to learn C.  I am trying to find
>> a dependency in my system.  `#` in all the other
>> languages I know is a comment.  So I was skipping
>> reading the code.
> 
> I would recommend you to ask relevant questions to your system support.
> 
> There's no Red Hat support here, only C programmers discussing C features.
> 
> For a company that worth over $16 billions at the NASDAQ, it would be very
> dubious to not be able to get a reliable support.
> 
> PS: The same could be said for Microsoft.
> 


If you did not like the "quality" of my question,
you did not have to read it or make snotty
comments about it.

You should have ignored it or asked for more information.
Or, just perhaps, told me what a "#" was.

[toc] | [prev] | [next] | [standalone]


#111441

FromIan Collins <ian-news@hotmail.com>
Date2017-06-04 11:17 +1200
Message-ID<epguckFbqeU1@mid.individual.net>
In reply to#111440
On 06/ 4/17 11:12 AM, T wrote:
> On 06/03/2017 03:36 PM, GOTHIER Nathan wrote:
>> On Sat, 3 Jun 2017 15:30:26 -0700
>> T <T@invalid.invalid> wrote:
>>
>>> I am not trying to learn C.  I am trying to find
>>> a dependency in my system.  `#` in all the other
>>> languages I know is a comment.  So I was skipping
>>> reading the code.
>>
>> I would recommend you to ask relevant questions to your system support.
>>
>> There's no Red Hat support here, only C programmers discussing C features.
>>
>> For a company that worth over $16 billions at the NASDAQ, it would be very
>> dubious to not be able to get a reliable support.
>>
>> PS: The same could be said for Microsoft.
>>
>
>
> If you did not like the "quality" of my question,
> you did not have to read it or make snotty
> comments about it.
>
> You should have ignored it or asked for more information.
> Or, just perhaps, told me what a "#" was.

Never argue with people who SHOUT their names on Usenet!

-- 
Ian

[toc] | [prev] | [next] | [standalone]


#111442

FromGOTHIER Nathan <nathan.gothier@gmail.com>
Date2017-06-04 01:23 +0200
Message-ID<20170604012318.eb2ce1b954681e13619580ad@gmail.com>
In reply to#111441
On Sun, 4 Jun 2017 11:17:40 +1200
Ian Collins <ian-news@hotmail.com> wrote:

> Never argue with people who SHOUT their names on Usenet!

I assume you didn't need that to be deaf. :o)

[toc] | [prev] | [next] | [standalone]


#111448

FromKeith Thompson <kst-u@mib.org>
Date2017-06-03 19:15 -0700
Message-ID<lnwp8slcr8.fsf@kst-u.example.com>
In reply to#111417
T <T@invalid.invalid> writes:
> On 06/03/2017 09:05 AM, Keith Thompson wrote:
>> T <T@invalid.invalid> writes:
>>> I don't understand C.  I am trying to find something
>>> in some source code.  What does "#" mean as in
>> [snip]
>>
>> You cannot learn C by asking about one feature at a time.  Find a
>> decent C book or tutorial (and feel free to ask here for advice
>> about finding one).
>
> I am not trying to learn C.  I am trying to find
> a missing dependency.  I can read Perl, Pascal, Modula2.
> I am lost when it comes to C.  Hopefully, when I
> find what I am looking for, I won't have to read C
> again for many years.  When it comes to C, there are
> folks far better at it than me and I will leave it to them.

OK.  I've seen a number of questions (not necessarily here) where
posters *seem* to be trying to learn C, or some other language,
by asking about one tiny feature at a time -- analagous to someone
trying to learn English by asking what "the" means.  It wasn't at all
clear from your original question what you were trying to accomplish.

It would have helped us to help you if you had given a little more
information about your goals in asking your question.  Some people
run into something called an "X/Y problem", where they need to do X,
assume that Y is the right approach, and then ask about Y.

You've probably gotten the information you need by now, but I'll
summarize.

Many scripting languages use the '#' character to introduce an
end-of-line commment.  C does not.  C comments are introduced by
/* and terminated by */ (and may span multiple lines, or part of
a line), or are introduce by // and run to the end of the line
(inherited from BCPL via C++, and introduced to C by the 1999
standard).

The # character at the beginning of a line (possibly preceded
and/or followed by white space) usually introduces a preprocessor
directive.  The preprocessor is a separate translation phase, run
before syntactic analysis.  It performs conditional compilation (#if,
#ifdef, #elif, #else, #endif), file inclusion (#include) and macro
definition and expansion (#define).  (The preprocessor also has #
and ## operators, but you probably don't need to worry about those.)

The preprocessor is described in definitive detail in section
6.10 of the current ISO C standard; the latest public draft is
http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1570.pdf

One more piece of advice.  You've gotten some particularly rude
responses (mine was not *intended* to be among them).  This newsgroup
is, unfortunately, infested with several trolls.  A lot of us
use killfiles to avoid seeing their nonsense.  Replying to them,
as we've found from long experience, is not useful, and further
damages the group's signal-to-noise ratio.

-- 
Keith Thompson (The_Other_Keith) kst-u@mib.org  <http://www.ghoti.net/~kst>
Working, but not speaking, for JetHead Development, Inc.
"We must do something.  This is something.  Therefore, we must do this."
    -- Antony Jay and Jonathan Lynn, "Yes Minister"

[toc] | [prev] | [next] | [standalone]


#111449

FromT <T@invalid.invalid>
Date2017-06-03 19:27 -0700
Message-ID<ogvr0h$8pm$1@dont-email.me>
In reply to#111448
On 06/03/2017 07:15 PM, Keith Thompson wrote:
> T <T@invalid.invalid> writes:
>> On 06/03/2017 09:05 AM, Keith Thompson wrote:
>>> T <T@invalid.invalid> writes:
>>>> I don't understand C.  I am trying to find something
>>>> in some source code.  What does "#" mean as in
>>> [snip]
>>>
>>> You cannot learn C by asking about one feature at a time.  Find a
>>> decent C book or tutorial (and feel free to ask here for advice
>>> about finding one).
>>
>> I am not trying to learn C.  I am trying to find
>> a missing dependency.  I can read Perl, Pascal, Modula2.
>> I am lost when it comes to C.  Hopefully, when I
>> find what I am looking for, I won't have to read C
>> again for many years.  When it comes to C, there are
>> folks far better at it than me and I will leave it to them.
> 
> OK.  I've seen a number of questions (not necessarily here) where
> posters *seem* to be trying to learn C, or some other language,
> by asking about one tiny feature at a time -- analagous to someone
> trying to learn English by asking what "the" means.  It wasn't at all
> clear from your original question what you were trying to accomplish.
> 
> It would have helped us to help you if you had given a little more
> information about your goals in asking your question.  Some people
> run into something called an "X/Y problem", where they need to do X,
> assume that Y is the right approach, and then ask about Y.
> 
> You've probably gotten the information you need by now, but I'll
> summarize.
> 
> Many scripting languages use the '#' character to introduce an
> end-of-line commment.  C does not.  C comments are introduced by
> /* and terminated by */ (and may span multiple lines, or part of
> a line), or are introduce by // and run to the end of the line
> (inherited from BCPL via C++, and introduced to C by the 1999
> standard).
> 
> The # character at the beginning of a line (possibly preceded
> and/or followed by white space) usually introduces a preprocessor
> directive.  The preprocessor is a separate translation phase, run
> before syntactic analysis.  It performs conditional compilation (#if,
> #ifdef, #elif, #else, #endif), file inclusion (#include) and macro
> definition and expansion (#define).  (The preprocessor also has #
> and ## operators, but you probably don't need to worry about those.)
> 
> The preprocessor is described in definitive detail in section
> 6.10 of the current ISO C standard; the latest public draft is
> http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1570.pdf
> 
> One more piece of advice.  You've gotten some particularly rude
> responses (mine was not *intended* to be among them).  This newsgroup
> is, unfortunately, infested with several trolls.  A lot of us
> use killfiles to avoid seeing their nonsense.  Replying to them,
> as we've found from long experience, is not useful, and further
> damages the group's signal-to-noise ratio.
> 

Hi Keith,

I was thinking that # was a comment mark.  I write in bash
and perl, where they are comment marks.  I was skipping over them.

I saw/am looking for a missing system call to an OS dependency.
 From what I can tell,

     HAVE_LIBNOTIFY7

Is loading a system decadency or a modules that call
a system dependency.

And

     $ rpm -qa \*notify\*
     libnotify-0.7.5-8.el7.x86_64

Has been a long running pain-in-my-ass.  Fedora is now
on 0.7.7.  I tried to rebuild Fedora's srpm, but I
landed in RPM hell.

Thank you for all the help, and point taken.

-T

[toc] | [prev] | [next] | [standalone]


#111480

FromManfred <noname@invalid.add>
Date2017-06-04 19:09 +0200
Message-ID<oh1et4$1ppm$1@gioia.aioe.org>
In reply to#111449
On 06/04/2017 04:27 AM, T wrote:
<snip>
> 
> I saw/am looking for a missing system call to an OS dependency.
>  From what I can tell,
> 
>      HAVE_LIBNOTIFY7
> 
> Is loading a system decadency or a modules that call
> a system dependency.
> 
> And
> 
>      $ rpm -qa \*notify\*
>      libnotify-0.7.5-8.el7.x86_64
> 
> Has been a long running pain-in-my-ass.  Fedora is now
> on 0.7.7.  I tried to rebuild Fedora's srpm, but I
> landed in RPM hell.
> 
> Thank you for all the help, and point taken.
> 
> -T

I am not sure I understand fully your problem (you gave limited info), 
but it looks like it is off-topic here.
Anyway, since this is started, you mentioned a preprocessor definition 
like 'HAVE_LIBNOTIFY7', rpm packages and (build) dependencies I /guess/ 
you are trying to build a program from source that has dependencies and 
makes use of some tool like autoconf and/or automake.
If this guess is correct and your program needs the libnotify package, 
in order to compile your program you need to install the libnotify-devel 
package, and run configure again.
This has nothing to do with C, it is only about how your program is 
intended to be built.

Hope this helps

[toc] | [prev] | [next] | [standalone]


#111519

FromT <T@invalid.invalid>
Date2017-06-05 01:56 -0700
Message-ID<oh364g$qbd$2@dont-email.me>
In reply to#111480
On 06/04/2017 10:09 AM, Manfred wrote:
> On 06/04/2017 04:27 AM, T wrote:
> <snip>
>>
>> I saw/am looking for a missing system call to an OS dependency.
>>  From what I can tell,
>>
>>      HAVE_LIBNOTIFY7
>>
>> Is loading a system decadency or a modules that call
>> a system dependency.
>>
>> And
>>
>>      $ rpm -qa \*notify\*
>>      libnotify-0.7.5-8.el7.x86_64
>>
>> Has been a long running pain-in-my-ass.  Fedora is now
>> on 0.7.7.  I tried to rebuild Fedora's srpm, but I
>> landed in RPM hell.
>>
>> Thank you for all the help, and point taken.
>>
>> -T
> 
> I am not sure I understand fully your problem (you gave limited info), 
> but it looks like it is off-topic here.
> Anyway, since this is started, you mentioned a preprocessor definition 
> like 'HAVE_LIBNOTIFY7', rpm packages and (build) dependencies I /guess/ 
> you are trying to build a program from source that has dependencies and 
> makes use of some tool like autoconf and/or automake.
> If this guess is correct and your program needs the libnotify package, 
> in order to compile your program you need to install the libnotify-devel 
> package, and run configure again.
> This has nothing to do with C, it is only about how your program is 
> intended to be built.
> 
> Hope this helps

You are most probably correct.  It is looking like it is a
compiler switch to turn libnotify off or on.  I have no
idea where to find it in the tar ball, but I will.

Thank you for the help!

-T

[toc] | [prev] | [next] | [standalone]


#111490

FromKeith Thompson <kst-u@mib.org>
Date2017-06-04 13:51 -0700
Message-ID<lno9u3lbn5.fsf@kst-u.example.com>
In reply to#111449
T <T@invalid.invalid> writes:
[...]
> I saw/am looking for a missing system call to an OS dependency.
> From what I can tell,
>
>     HAVE_LIBNOTIFY7
>
> Is loading a system decadency or a modules that call
> a system dependency.

If you want to ask us about HAVE_LIBNOTIFY7, you'll have to tell us
what it is.  Is it a C preprocessor macro?  A symbol in a Makefile?
An environment variable?  A symbol defined in a shell script?
Something else?

It seems to be close to the core of what you're trying to figure
out, but you're not giving us enough information to help you.
And it's likely to be off-topic here, but with more information we
might be able to help you find a better place to ask your questions.
Perhaps comp.unix.programmer would be better?

And I suspect that what you're looking for is not a system call, but a
call to a library function (those are two different things).  But you
haven't said what system call or function you're looking for.

-- 
Keith Thompson (The_Other_Keith) kst-u@mib.org  <http://www.ghoti.net/~kst>
Working, but not speaking, for JetHead Development, Inc.
"We must do something.  This is something.  Therefore, we must do this."
    -- Antony Jay and Jonathan Lynn, "Yes Minister"

[toc] | [prev] | [next] | [standalone]


#111520

FromT <T@invalid.invalid>
Date2017-06-05 01:57 -0700
Message-ID<oh3678$qbd$3@dont-email.me>
In reply to#111490
On 06/04/2017 01:51 PM, Keith Thompson wrote:
> T <T@invalid.invalid> writes:
> [...]
>> I saw/am looking for a missing system call to an OS dependency.
>>  From what I can tell,
>>
>>      HAVE_LIBNOTIFY7
>>
>> Is loading a system decadency or a modules that call
>> a system dependency.
> 
> If you want to ask us about HAVE_LIBNOTIFY7, you'll have to tell us
> what it is.  Is it a C preprocessor macro?  A symbol in a Makefile?
> An environment variable?  A symbol defined in a shell script?
> Something else?
> 
> It seems to be close to the core of what you're trying to figure
> out, but you're not giving us enough information to help you.
> And it's likely to be off-topic here, but with more information we
> might be able to help you find a better place to ask your questions.
> Perhaps comp.unix.programmer would be better?
> 
> And I suspect that what you're looking for is not a system call, but a
> call to a library function (those are two different things).  But you
> haven't said what system call or function you're looking for.
> 

Hi Keith,

Actually I got what I needed from you guys.  I am
hot on the trail on a compiler switch to enable
libnotify.  It is somewhere in the tar ball.
I have no idea where, but I will.

:-)

Thank yo for the help!

-T

[toc] | [prev] | [next] | [standalone]


#111451

FromJames Kuyper <jameskuyper@verizon.net>
Date2017-06-03 23:08 -0400
Message-ID<ogvtcl$e1f$1@dont-email.me>
In reply to#111333
On 06/03/2017 03:39 AM, T wrote:
> Hi All,
> 
> I don't understand C.  I am trying to find something
> in some source code.  What does "#" mean as in

There is one context in which # has a specific meaning of it's own. This
isn't that context.

> #include "check_events.h"
> 
> and
> 
> #ifdef HAVE_LIBNOTIFY7
>      notification = notify_notification_new(summary, body, 
> "dialog-warning");
> #else
>      notification = notify_notification_new(summary, body, 
> "dialog-warning", NULL);
> #endif /* HAVE_LIBNOTIFY7 */

C has something called pre-processing directives. Every single
pre-processing directive starts with "#", and every line where the first
non-whitespace character is a "#" is a pre-processing directive (that's
true because, if # is followed by anything other than one of the
standard-defined pre-processing directives, it qualifies as a
"non-directive" - and, confusingly enough, a non-directive is considered
to be one kind of pre-processing directive. (6.10p1).
I'm not the one who chose to name those concepts that way, and I make no
attempt to justify choosing those names - I'm just telling you what the
standard says.

[toc] | [prev] | [next] | [standalone]


#111452

FromT <T@invalid.invalid>
Date2017-06-03 20:53 -0700
Message-ID<oh001s$k4l$1@dont-email.me>
In reply to#111451
On 06/03/2017 08:08 PM, James Kuyper wrote:
> On 06/03/2017 03:39 AM, T wrote:
>> Hi All,
>>
>> I don't understand C.  I am trying to find something
>> in some source code.  What does "#" mean as in
> 
> There is one context in which # has a specific meaning of it's own. This
> isn't that context.
> 
>> #include "check_events.h"
>>
>> and
>>
>> #ifdef HAVE_LIBNOTIFY7
>>       notification = notify_notification_new(summary, body,
>> "dialog-warning");
>> #else
>>       notification = notify_notification_new(summary, body,
>> "dialog-warning", NULL);
>> #endif /* HAVE_LIBNOTIFY7 */
> 
> C has something called pre-processing directives. Every single
> pre-processing directive starts with "#", and every line where the first
> non-whitespace character is a "#" is a pre-processing directive (that's
> true because, if # is followed by anything other than one of the
> standard-defined pre-processing directives, it qualifies as a
> "non-directive" - and, confusingly enough, a non-directive is considered
> to be one kind of pre-processing directive. (6.10p1).
> I'm not the one who chose to name those concepts that way, and I make no
> attempt to justify choosing those names - I'm just telling you what the
> standard says.
> 

Thank you!  I thought it was a comment.

[toc] | [prev] | [next] | [standalone]


#111574

FromJohn Bode <jfbode1029@gmail.com>
Date2017-06-05 12:44 -0700
Message-ID<f638a4c5-bfca-4793-b1cf-d36dd7b2ea53@googlegroups.com>
In reply to#111452
On Saturday, June 3, 2017 at 10:53:59 PM UTC-5, T wrote:
> On 06/03/2017 08:08 PM, James Kuyper wrote:
> > On 06/03/2017 03:39 AM, T wrote:
> >> Hi All,
> >>
> >> I don't understand C.  I am trying to find something
> >> in some source code.  What does "#" mean as in
> > 
> > There is one context in which # has a specific meaning of it's own. This
> > isn't that context.
> > 
> >> #include "check_events.h"
> >>
> >> and
> >>
> >> #ifdef HAVE_LIBNOTIFY7
> >>       notification = notify_notification_new(summary, body,
> >> "dialog-warning");
> >> #else
> >>       notification = notify_notification_new(summary, body,
> >> "dialog-warning", NULL);
> >> #endif /* HAVE_LIBNOTIFY7 */
> > 
> > C has something called pre-processing directives. Every single
> > pre-processing directive starts with "#", and every line where the first
> > non-whitespace character is a "#" is a pre-processing directive (that's
> > true because, if # is followed by anything other than one of the
> > standard-defined pre-processing directives, it qualifies as a
> > "non-directive" - and, confusingly enough, a non-directive is considered
> > to be one kind of pre-processing directive. (6.10p1).
> > I'm not the one who chose to name those concepts that way, and I make no
> > attempt to justify choosing those names - I'm just telling you what the
> > standard says.
> > 
> 
> Thank you!  I thought it was a comment.

For reference, there are two sets of comment delimiters in C.  There is the
pair of delimiters /* and */ - anything that appears between them is a
comment:

    /* This is a comment */

    /**
     * So is this
     */

There's also the single delimiter // - anything between that and the next 
newline is a comment:

    // the rest of this line is a comment

Comments in C do not "nest" - You can't do something like

    /* some text /* some more text */ yet more text */

The compiler will consider the first */ it sees to end the comment, and
everything after that will be treated as source code, which will lead
to a compile error.  

[toc] | [prev] | [next] | [standalone]


#111587

FromT <T@invalid.invalid>
Date2017-06-05 14:52 -0700
Message-ID<oh4jl0$vqa$1@dont-email.me>
In reply to#111574
On 06/05/2017 12:44 PM, John Bode wrote:
> On Saturday, June 3, 2017 at 10:53:59 PM UTC-5, T wrote:
>> On 06/03/2017 08:08 PM, James Kuyper wrote:
>>> On 06/03/2017 03:39 AM, T wrote:
>>>> Hi All,
>>>>
>>>> I don't understand C.  I am trying to find something
>>>> in some source code.  What does "#" mean as in
>>>
>>> There is one context in which # has a specific meaning of it's own. This
>>> isn't that context.
>>>
>>>> #include "check_events.h"
>>>>
>>>> and
>>>>
>>>> #ifdef HAVE_LIBNOTIFY7
>>>>        notification = notify_notification_new(summary, body,
>>>> "dialog-warning");
>>>> #else
>>>>        notification = notify_notification_new(summary, body,
>>>> "dialog-warning", NULL);
>>>> #endif /* HAVE_LIBNOTIFY7 */
>>>
>>> C has something called pre-processing directives. Every single
>>> pre-processing directive starts with "#", and every line where the first
>>> non-whitespace character is a "#" is a pre-processing directive (that's
>>> true because, if # is followed by anything other than one of the
>>> standard-defined pre-processing directives, it qualifies as a
>>> "non-directive" - and, confusingly enough, a non-directive is considered
>>> to be one kind of pre-processing directive. (6.10p1).
>>> I'm not the one who chose to name those concepts that way, and I make no
>>> attempt to justify choosing those names - I'm just telling you what the
>>> standard says.
>>>
>>
>> Thank you!  I thought it was a comment.
> 
> For reference, there are two sets of comment delimiters in C.  There is the
> pair of delimiters /* and */ - anything that appears between them is a
> comment:
> 
>      /* This is a comment */
> 
>      /**
>       * So is this
>       */
> 
> There's also the single delimiter // - anything between that and the next
> newline is a comment:
> 
>      // the rest of this line is a comment
> 
> Comments in C do not "nest" - You can't do something like
> 
>      /* some text /* some more text */ yet more text */
> 
> The compiler will consider the first */ it sees to end the comment, and
> everything after that will be treated as source code, which will lead
> to a compile error.
> 

Thank you!

[toc] | [prev] | [next] | [standalone]


#111524

FromT <T@invalid.invalid>
Date2017-06-05 03:00 -0700
Message-ID<oh39sq$7nl$1@dont-email.me>
In reply to#111333
On 06/03/2017 12:39 AM, T wrote:
> Hi All,
> 
> I don't understand C.  I am trying to find something
> in some source code.  What does "#" mean as in
> 
> #include "check_events.h"
> 
> and
> 
> #ifdef HAVE_LIBNOTIFY7
>      notification = notify_notification_new(summary, body, 
> "dialog-warning");
> #else
>      notification = notify_notification_new(summary, body, 
> "dialog-warning", NULL);
> #endif /* HAVE_LIBNOTIFY7 */
> 
> 
> Is this a comment mark?  And how does it work in "if, else, endif"?
> 
> Many thanks,
> -T

Followup:  The issue was resolved.  Turning libnotify
back on in the compilers switched fix it.  Thank you
all for the help!

-T

[toc] | [prev] | [standalone]


Page 2 of 2 — ← Prev page 1 [2]

Back to top | Article view | comp.lang.c


csiph-web