Standard Defines

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • pemo

    #1

    Standard Defines

    Are there standard macros that a (c99) compliant compiler should support?

    I note that in the c99 std that __FILE__ __LINE__ __func__ are
    mentioned, but others (that seem to be built in to every compiler I
    currently use) like __DATE__ __TIME___ don't appear. Presumably,
    __TIME__ etc are just simply 'popular' rather than required?


  • Richard Heathfield

    #2
    Re: Standard Defines

    pemo said:
    [color=blue]
    > Are there standard macros that a (c99) compliant compiler should support?
    >
    > I note that in the c99 std that __FILE__ __LINE__ __func__ are
    > mentioned, but others (that seem to be built in to every compiler I
    > currently use) like __DATE__ __TIME___ don't appear.[/color]

    Look harder. They are both there.

    --
    Richard Heathfield
    "Usenet is a strange place" - dmr 29/7/1999

    email: rjh at above domain (but drop the www, obviously)

    Comment

    • pemo

      #3
      Re: Standard Defines


      "Richard Heathfield" <invalid@invali d.invalid> wrote in message
      news:dmmna5$rqk $1@nwrdmz02.dmz .ncs.ea.ibs-infra.bt.com...[color=blue]
      > pemo said:
      >[color=green]
      >> Are there standard macros that a (c99) compliant compiler should support?
      >>
      >> I note that in the c99 std that __FILE__ __LINE__ __func__ are
      >> mentioned, but others (that seem to be built in to every compiler I
      >> currently use) like __DATE__ __TIME___ don't appear.[/color]
      >
      > Look harder. They are both there.[/color]


      So they are!

      Interesting - when given __, acrobat reader, finds 7.2.2 (__FILE__ etc),
      but nothing else - however, give it DATE, and it finds 6.10.8 - containing
      __DATE__ etc! Weird


      Comment

      • those who know me have no need of my name

        #4
        Re: Standard Defines

        in comp.lang.c i read:
        [color=blue]
        >Are there standard macros that a (c99) compliant compiler should support?[/color]

        yes. the standard enumerates them.
        [color=blue]
        >I note that in the c99 std that __FILE__ __LINE__ __func__ are
        >mentioned,[/color]

        __func__ isn't a macro.
        [color=blue]
        >but others (that seem to be built in to every compiler I
        >currently use) like __DATE__ __TIME___ don't appear. Presumably,
        >__TIME__ etc are just simply 'popular' rather than required?[/color]

        they are in the list -- see 6.10.8 for the basic list you are after.

        --
        a signature

        Comment

        • Michael Mair

          #5
          [OT] Finding stuff in the standard (was: Standard Defines)

          pemo wrote:[color=blue]
          > "Richard Heathfield" <invalid@invali d.invalid> wrote in message
          > news:dmmna5$rqk $1@nwrdmz02.dmz .ncs.ea.ibs-infra.bt.com...
          >[color=green]
          >>pemo said:
          >>
          >>[color=darkred]
          >>>Are there standard macros that a (c99) compliant compiler should support?
          >>>
          >>>I note that in the c99 std that __FILE__ __LINE__ __func__ are
          >>>mentioned, but others (that seem to be built in to every compiler I
          >>>currently use) like __DATE__ __TIME___ don't appear.[/color]
          >>
          >>Look harder. They are both there.[/color]
          >
          > So they are!
          >
          > Interesting - when given __, acrobat reader, finds 7.2.2 (__FILE__ etc),
          > but nothing else - however, give it DATE, and it finds 6.10.8 - containing
          > __DATE__ etc! Weird[/color]

          Yep; in most cases, a plain text file is better for searching.
          I keep the relevant last public draft around in this form just
          for this reason. After finding something there, I still can
          look into the standard to verify the information from the draft.

          Cheers
          Michael
          --
          E-Mail: Mine is an /at/ gmx /dot/ de address.

          Comment

          • Keith Thompson

            #6
            Re: [OT] Finding stuff in the standard (was: Standard Defines)

            Michael Mair <Michael.Mair@i nvalid.invalid> writes:[color=blue]
            > pemo wrote:[color=green]
            >> "Richard Heathfield" <invalid@invali d.invalid> wrote in message
            >> news:dmmna5$rqk $1@nwrdmz02.dmz .ncs.ea.ibs-infra.bt.com...
            >>[color=darkred]
            >>>pemo said:
            >>>
            >>>
            >>>>Are there standard macros that a (c99) compliant compiler should support?
            >>>>
            >>>>I note that in the c99 std that __FILE__ __LINE__ __func__ are
            >>>>mentioned , but others (that seem to be built in to every compiler I
            >>>>currently use) like __DATE__ __TIME___ don't appear.
            >>>
            >>>Look harder. They are both there.[/color]
            >> So they are!
            >> Interesting - when given __, acrobat reader, finds 7.2.2 (__FILE__
            >> etc), but nothing else - however, give it DATE, and it finds 6.10.8
            >> - containing __DATE__ etc! Weird[/color]
            >
            > Yep; in most cases, a plain text file is better for searching.
            > I keep the relevant last public draft around in this form just
            > for this reason. After finding something there, I still can
            > look into the standard to verify the information from the draft.[/color]

            Note that the standard, even in its PDF version, still has an
            old-fashioned section at the end called an "index", where you'll find
            a number of identifiers starting with "__".

            --
            Keith Thompson (The_Other_Keit h) kst-u@mib.org <http://www.ghoti.net/~kst>
            San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
            We must do something. This is something. Therefore, we must do this.

            Comment

            • pemo

              #7
              Re: [OT] Finding stuff in the standard (was: Standard Defines)


              "Michael Mair" <Michael.Mair@i nvalid.invalid> wrote in message
              news:3v9cajF14q snsU1@individua l.net...[color=blue]
              > pemo wrote:[color=green]
              >> "Richard Heathfield" <invalid@invali d.invalid> wrote in message
              >> news:dmmna5$rqk $1@nwrdmz02.dmz .ncs.ea.ibs-infra.bt.com...
              >>[color=darkred]
              >>>pemo said:
              >>>
              >>>
              >>>>Are there standard macros that a (c99) compliant compiler should
              >>>>support?
              >>>>
              >>>>I note that in the c99 std that __FILE__ __LINE__ __func__ are
              >>>>mentioned , but others (that seem to be built in to every compiler I
              >>>>currently use) like __DATE__ __TIME___ don't appear.
              >>>
              >>>Look harder. They are both there.[/color]
              >>
              >> So they are!
              >>
              >> Interesting - when given __, acrobat reader, finds 7.2.2 (__FILE__ etc),
              >> but nothing else - however, give it DATE, and it finds 6.10.8 -
              >> containing __DATE__ etc! Weird[/color]
              >
              > Yep; in most cases, a plain text file is better for searching.
              > I keep the relevant last public draft around in this form just
              > for this reason. After finding something there, I still can
              > look into the standard to verify the information from the draft.[/color]

              Hmmm - must check to see if Acrobat files can be saved as 'test' - the
              search facility in Acrobat can only get better - can't it??



              Comment

              • pemo

                #8
                Re: [OT] Finding stuff in the standard (was: Standard Defines)


                "Keith Thompson" <kst-u@mib.org> wrote in message
                news:lnu0dsh1im .fsf@nuthaus.mi b.org...[color=blue]
                > Michael Mair <Michael.Mair@i nvalid.invalid> writes:[color=green]
                >> pemo wrote:[color=darkred]
                >>> "Richard Heathfield" <invalid@invali d.invalid> wrote in message
                >>> news:dmmna5$rqk $1@nwrdmz02.dmz .ncs.ea.ibs-infra.bt.com...
                >>>
                >>>>pemo said:
                >>>>
                >>>>
                >>>>>Are there standard macros that a (c99) compliant compiler should
                >>>>>support?
                >>>>>
                >>>>>I note that in the c99 std that __FILE__ __LINE__ __func__ are
                >>>>>mentione d, but others (that seem to be built in to every compiler I
                >>>>>currentl y use) like __DATE__ __TIME___ don't appear.
                >>>>
                >>>>Look harder. They are both there.
                >>> So they are!
                >>> Interesting - when given __, acrobat reader, finds 7.2.2 (__FILE__
                >>> etc), but nothing else - however, give it DATE, and it finds 6.10.8
                >>> - containing __DATE__ etc! Weird[/color]
                >>
                >> Yep; in most cases, a plain text file is better for searching.
                >> I keep the relevant last public draft around in this form just
                >> for this reason. After finding something there, I still can
                >> look into the standard to verify the information from the draft.[/color]
                >
                > Note that the standard, even in its PDF version, still has an
                > old-fashioned section at the end called an "index", where you'll find
                > a number of identifiers starting with "__".[/color]

                Yup, you're right Keith - sometimes I think (realise!) that despite all my
                years/education - well - I'm basically pretty dumb ... or, yet another way
                to look at that ... I should at least try everything in the book *before* I
                ask such stuff. MEMO TO SELF!


                Comment

                • Michael Mair

                  #9
                  Re: [OT] Finding stuff in the standard

                  Keith Thompson wrote:[color=blue]
                  > Michael Mair <Michael.Mair@i nvalid.invalid> writes:
                  >[color=green]
                  >>pemo wrote:
                  >>[color=darkred]
                  >>>"Richard Heathfield" <invalid@invali d.invalid> wrote in message
                  >>>news:dmmna5$ rqk$1@nwrdmz02. dmz.ncs.ea.ibs-infra.bt.com...
                  >>>
                  >>>
                  >>>>pemo said:
                  >>>>
                  >>>>
                  >>>>
                  >>>>>Are there standard macros that a (c99) compliant compiler should support?
                  >>>>>
                  >>>>>I note that in the c99 std that __FILE__ __LINE__ __func__ are
                  >>>>>mentione d, but others (that seem to be built in to every compiler I
                  >>>>>currentl y use) like __DATE__ __TIME___ don't appear.
                  >>>>
                  >>>>Look harder. They are both there.
                  >>>
                  >>>So they are!
                  >>>Interestin g - when given __, acrobat reader, finds 7.2.2 (__FILE__
                  >>>etc), but nothing else - however, give it DATE, and it finds 6.10.8
                  >>>- containing __DATE__ etc! Weird[/color]
                  >>
                  >>Yep; in most cases, a plain text file is better for searching.
                  >>I keep the relevant last public draft around in this form just
                  >>for this reason. After finding something there, I still can
                  >>look into the standard to verify the information from the draft.[/color]
                  >
                  > Note that the standard, even in its PDF version, still has an
                  > old-fashioned section at the end called an "index", where you'll find
                  > a number of identifiers starting with "__".[/color]

                  *g* Yep, should have mentioned this curious device.

                  However, even though the standard's index is rather complete,
                  it is still a technical book and suffers in part from the
                  useless index syndrome: You often have to know the answer and part
                  of the wording used in the answer to find the answer when using
                  index and table of contents. (The only technical book with an
                  index that could -- with one level of indirection, of course --
                  up to now answer all my questions is the second edition of the
                  LaTeX Companion; this is in part because I did not use it much
                  but in part because the team of authors had a pro making the index.)

                  If the author or the team writing the book does not aim at an
                  excellent index from the beginning, then the index often is the
                  part which suffers when time and money grow short...
                  Whenever I write some technical text where I am not bound to use
                  a well-known text "processing " tool out of Redmond, the index
                  indeed is part of the writing process. This way, I have only to
                  weed out the unnecessary parts; in addition, I ask friends to
                  "ask" the text questions and try to answer them in a couple of
                  minutes using the index.

                  Cheers
                  Michael
                  --
                  E-Mail: Mine is an /at/ gmx /dot/ de address.

                  Comment

                  • Mark McIntyre

                    #10
                    Re: [OT] Finding stuff in the standard (was: Standard Defines)

                    On Thu, 01 Dec 2005 23:38:01 +0100, in comp.lang.c , Michael Mair
                    <Michael.Mair@i nvalid.invalid> wrote:
                    [color=blue]
                    >
                    >Yep; in most cases, a plain text file is better for searching.[/color]

                    You guys must have badly broken PDF readers :-)

                    I find the pdf just fine to search, takes about 2 seconds to search
                    the whole thing, and no problems finding all the things we've talked
                    about here.
                    --
                    Mark McIntyre
                    CLC FAQ <http://www.eskimo.com/~scs/C-faq/top.html>
                    CLC readme: <http://www.ungerhu.com/jxh/clc.welcome.txt >

                    ----== Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet News==----
                    http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
                    ----= East and West-Coast Server Farms - Total Privacy via Encryption =----

                    Comment

                    • Flash Gordon

                      #11
                      Re: [OT] Finding stuff in the standard

                      pemo wrote:[color=blue]
                      > "Michael Mair" <Michael.Mair@i nvalid.invalid> wrote in message
                      > news:3v9cajF14q snsU1@individua l.net...[/color]

                      <snip>
                      [color=blue][color=green]
                      >> Yep; in most cases, a plain text file is better for searching.
                      >> I keep the relevant last public draft around in this form just
                      >> for this reason. After finding something there, I still can
                      >> look into the standard to verify the information from the draft.[/color]
                      >
                      > Hmmm - must check to see if Acrobat files can be saved as 'test' - the
                      > search facility in Acrobat can only get better - can't it??[/color]

                      If not, then in windows you can create a "printer" attached to port
                      "file:" of type "Generic / Text Only" which will probably be good
                      enough. In *nix there are other methods to generate a text file from a PDF.
                      --
                      Flash Gordon
                      Living in interesting times.
                      Although my email address says spam, it is real and I read it.

                      Comment

                      • lawrence.jones@ugs.com

                        #12
                        Re: Standard Defines

                        pemo <usenetmeister@ gmail.com> wrote:[color=blue]
                        >
                        > Interesting - when given __, acrobat reader, finds 7.2.2 (__FILE__ etc),
                        > but nothing else - however, give it DATE, and it finds 6.10.8 - containing
                        > __DATE__ etc! Weird[/color]

                        That may be because there's actually a very thin space between the two
                        underscores (otherwise they tend to blend together, making it hard to
                        tell that they're two separate characters). I don't know why it would
                        find some and not the others, though.

                        -Larry Jones

                        You don't get to be Mom if you can't fix everything just right. -- Calvin

                        Comment

                        • lawrence.jones@ugs.com

                          #13
                          Re: [OT] Finding stuff in the standard

                          Michael Mair <Michael.Mair@i nvalid.invalid> wrote:[color=blue]
                          >
                          > However, even though the standard's index is rather complete,
                          > it is still a technical book and suffers in part from the
                          > useless index syndrome: You often have to know the answer and part
                          > of the wording used in the answer to find the answer when using
                          > index and table of contents.[/color]

                          Hopefully it's better than the complete useless indexes that are
                          automatically generated and thus contain every mention of a term without
                          any clue as to which are actually interesting and which are not. I'm
                          always open to suggestions for improvements either directly or via
                          comp.std.c.

                          -Larry Jones

                          Some people just don't have inquisitive minds. -- Calvin

                          Comment

                          • Michael Mair

                            #14
                            Re: [OT] Finding stuff in the standard

                            Mark McIntyre wrote:[color=blue]
                            > On Thu, 01 Dec 2005 23:38:01 +0100, in comp.lang.c , Michael Mair
                            > <Michael.Mair@i nvalid.invalid> wrote:
                            >[color=green]
                            >>Yep; in most cases, a plain text file is better for searching.[/color]
                            >
                            > You guys must have badly broken PDF readers :-)
                            >
                            > I find the pdf just fine to search, takes about 2 seconds to search
                            > the whole thing, and no problems finding all the things we've talked
                            > about here.[/color]

                            Well, there are things, especially in code examples, that
                            I cannot find via AR or xpdf. This may be a problem of the
                            pdf file itself. Having had enough fun with "intelligen t"
                            pdf generation, I use the much more "grep"able text files...

                            Cheers
                            Michael
                            --
                            E-Mail: Mine is an /at/ gmx /dot/ de address.

                            Comment

                            • Michael Mair

                              #15
                              Re: [OT] Finding stuff in the standard

                              lawrence.jones@ ugs.com wrote:[color=blue]
                              > Michael Mair <Michael.Mair@i nvalid.invalid> wrote:
                              >[color=green]
                              >>However, even though the standard's index is rather complete,
                              >>it is still a technical book and suffers in part from the
                              >>useless index syndrome: You often have to know the answer and part
                              >>of the wording used in the answer to find the answer when using
                              >>index and table of contents.[/color]
                              >
                              > Hopefully it's better than the complete useless indexes that are
                              > automatically generated and thus contain every mention of a term without
                              > any clue as to which are actually interesting and which are not.[/color]

                              Definitely!
                              Also better than the standard publisher-provided index.
                              [color=blue]
                              > I'm
                              > always open to suggestions for improvements either directly or via
                              > comp.std.c.[/color]

                              As it is a standard document, it is fine as it is.
                              I have no suggestions; however, sometimes I wish for a
                              meta-index giving someone who does not breathe the
                              terminology daily the right keywords to look for.

                              However, it never occurred to me to just ask for a
                              certain index entry. I will keep a list now...

                              Cheers
                              Michael
                              --
                              E-Mail: Mine is an /at/ gmx /dot/ de address.

                              Comment

                              Working...