errors and casting

Discussion in 'C Programming' started by jacob navia, Apr 14, 2010.

  1. jacob navia

    jacob navia Guest

    Bill Cunningham a écrit :

    [snip]

    The truth is that you were "studying sockets" six years ago in
    comp.os.ms-windows.programmer.win32 and
    microsoft.public.win32.programmer.ole, where you were asking Win32
    programmers WinSock-flavoured versions of the questions that you are now
    asking Unix programmers. Your postings would have the world think that
    you have made zero progress in learning how to compile even basic C
    programs in eight years, when you first started talking about how you
    were using DJGPP and mingw. Indeed you are trying to convince people
    that you have less grasp of things now than you did when you were
    talking about recompiling gcc in comp.os.linux.development.apps in 2005,
    or about the Standard C library in kernel-mode code in comp.lang.c back
    in 2003, or about microkernels in comp.os.linux.development.system in
    2002, or about how to use DJGPP in comp.os.linux in 2002, or about Win32
    API programming in comp.programming in 2002.

    More and more people are not going to fall for this any more. Jens
    Thoms Toerring has sussed you. santosh and Mark McIntyre sussed you in
    2005. They'll all no doubt be disappointed to learn that it took them
    longer than Eric Tomson, who sussed you in 2002 when you asked Linus
    Torvalds silly questions on the IETF mailing list.
    jacob navia, Apr 14, 2010
    #1
    1. Advertising

  2. "Bill Cunningham" <> wrote in message
    news:4bc6307e$0$12445

    [...]

    > memset(&a,'\0',sizeof a);
    > a.ai_socket = SOCK_STREAM;
    > a.ai_family = AF_INET;
    > a.ai_flags = AI_PASSIVE;


    OK if these need to be within a function please note I if I can don't
    want them in a function. Maybe a header or .o file.

    B
    Bill Cunningham, Apr 14, 2010
    #2
    1. Advertising

  3. jacob navia

    jacob navia Guest

    Bill Cunningham a écrit :
    > "Bill Cunningham" <> wrote in message
    > news:4bc6307e$0$12445
    >
    > [...]
    >
    >> memset(&a,'\0',sizeof a);
    >> a.ai_socket = SOCK_STREAM;
    >> a.ai_family = AF_INET;
    >> a.ai_flags = AI_PASSIVE;

    >
    > OK if these need to be within a function please note I if I can don't
    > want them in a function. Maybe a header or .o file.
    >
    > B
    >
    >


    The truth is that you were "studying sockets" six years ago in
    comp.os.ms-windows.programmer.win32 and
    microsoft.public.win32.programmer.ole, where you were asking Win32
    programmers WinSock-flavoured versions of the questions that you are now
    asking Unix programmers. Your postings would have the world think that
    you have made zero progress in learning how to compile even basic C
    programs in eight years, when you first started talking about how you
    were using DJGPP and mingw. Indeed you are trying to convince people
    that you have less grasp of things now than you did when you were
    talking about recompiling gcc in comp.os.linux.development.apps in 2005,
    or about the Standard C library in kernel-mode code in comp.lang.c back
    in 2003, or about microkernels in comp.os.linux.development.system in
    2002, or about how to use DJGPP in comp.os.linux in 2002, or about Win32
    API programming in comp.programming in 2002.

    More and more people are not going to fall for this any more. Jens
    Thoms Toerring has sussed you. santosh and Mark McIntyre sussed you in
    2005. They'll all no doubt be disappointed to learn that it took them
    longer than Eric Tomson, who sussed you in 2002 when you asked Linus
    Torvalds silly questions on the IETF mailing list.
    jacob navia, Apr 14, 2010
    #3
  4. jacob navia

    Lew Pitcher Guest

    On April 14, 2010 17:36, in comp.lang.c, lid wrote:

    >
    > "Bill Cunningham" <> wrote in message
    > news:4bc6307e$0$12445
    >
    > [...]
    >
    >> memset(&a,'\0',sizeof a);
    >> a.ai_socket = SOCK_STREAM;
    >> a.ai_family = AF_INET;
    >> a.ai_flags = AI_PASSIVE;

    >
    > OK if these need to be within a function please note I if I can don't
    > want them in a function. Maybe a header or .o file.


    Yes, Bill, those four statements *cannot* stand alone outside a function
    body.

    You are going to have to find a way to /put/ them within a function body
    (your choice of /which/ function body) before your program will compile
    properly.

    --
    Lew Pitcher
    Master Codewright & JOAT-in-training | Registered Linux User #112576
    Me: http://pitcher.digitalfreehold.ca/ | Just Linux: http://justlinux.ca/
    ---------- Slackware - Because I know what I'm doing. ------
    Lew Pitcher, Apr 14, 2010
    #4
  5. "Bill Cunningham" <> writes:
    > I have honestly went over and over this and don't see the errors.

    [snip]

    All statements must be inside some function.

    --
    Keith Thompson (The_Other_Keith) <http://www.ghoti.net/~kst>
    Nokia
    "We must do something. This is something. Therefore, we must do this."
    -- Antony Jay and Jonathan Lynn, "Yes Minister"
    Keith Thompson, Apr 14, 2010
    #5
  6. jacob navia <> writes:
    > Bill Cunningham a écrit :
    >
    > [snip]
    >
    > The truth is that you were "studying sockets" six years ago in
    > comp.os.ms-windows.programmer.win32 and
    > microsoft.public.win32.programmer.ole, where you were asking Win32
    > programmers WinSock-flavoured versions of the questions that you are
    > now asking Unix programmers. Your postings would have the world think
    > that you have made zero progress in learning how to compile even basic
    > C programs in eight years, when you first started talking about how
    > you were using DJGPP and mingw. Indeed you are trying to convince
    > people that you have less grasp of things now than you did when you
    > were talking about recompiling gcc in comp.os.linux.development.apps
    > in 2005, or about the Standard C library in kernel-mode code in
    > comp.lang.c back in 2003, or about microkernels in
    > comp.os.linux.development.system in 2002, or about how to use DJGPP in
    > comp.os.linux in 2002, or about Win32 API programming in
    > comp.programming in 2002.
    >
    > More and more people are not going to fall for this any more. Jens
    > Thoms Toerring has sussed you. santosh and Mark McIntyre sussed you
    > in 2005. They'll all no doubt be disappointed to learn that it took
    > them longer than Eric Tomson, who sussed you in 2002 when you asked
    > Linus Torvalds silly questions on the IETF mailing list.


    I was about to complain about your posting the above two paragraphs
    (which you didn't originally write) without acknowledging the
    author. Since the author happens to be someone who deliberately
    snips attribution lines, I won't complain about that or identify
    the author.

    Neverthess, even he doesn't posted quoted text without indicating
    that it's quoted text. The above looks just as it would if you,
    jacob, had written it yourself; I only realized you hadn't because
    I recognized that the writing isn't in your style. Apart from any
    other reasons not to do this, it's confusing to your readers.

    And you've posted the same thing at least three times in response
    to Bill's posts. The point has been made. Please stop before you
    exceed the Breidbart Index.

    --
    Keith Thompson (The_Other_Keith) <http://www.ghoti.net/~kst>
    Nokia
    "We must do something. This is something. Therefore, we must do this."
    -- Antony Jay and Jonathan Lynn, "Yes Minister"
    Keith Thompson, Apr 14, 2010
    #6
  7. I have honestly went over and over this and don't see the errors. In
    memset's first parameter I even cast a void* and I don't like casts. I don't
    know where the errors are from. I believe I have all the required posix
    standard headers.

    #include <stdio.h>
    #include <stdlib.h>
    #include <errno.h>
    #include <string.h>
    #include <netdb.h>
    #include <sys/socket.h>

    struct addrinfo a, *pa;

    int stat;
    void error(void)
    {
    fprintf(stderr, "Error: %d\n", errno);
    exit(EXIT_FAILURE);
    }

    memset(&a,'\0',sizeof a);
    a.ai_socket = SOCK_STREAM;
    a.ai_family = AF_INET;
    a.ai_flags = AI_PASSIVE;
    17: error: syntax error before '&' token
    error: conflicting types for 'memset'
    error: conflicting types for 'memset'
    warning: data definition has no type or storage class
    18: error: syntax error before '.' token

    That last error above has me baffled. I have written the error function so I
    can call it when an error check proves there's an error.

    Bill
    Bill Cunningham, Apr 15, 2010
    #7
  8. On 14 Apr, 22:36, "Bill Cunningham" <> wrote:
    > "Bill Cunningham" <> wrote in message
    >
    > news:4bc6307e$0$12445
    >
    > [...]
    >
    > > memset(&a,'\0',sizeof a);
    > > a.ai_socket = SOCK_STREAM;
    > > a.ai_family = AF_INET;
    > > a.ai_flags = AI_PASSIVE;

    >
    >     OK if these need to be within a function please note I if I can don't
    > want them in a function. Maybe a header or .o file.


    try rewriting it in pascal then
    Nick Keighley, Apr 15, 2010
    #8
  9. io_x wrote:

    > if you can write so difficult english why have you some problem with
    > C?


    [snip]

    > what does it mean "AI_PASSIVE?


    AI_PASSIVE is a pre-defined macro used in the posix networking standard
    to allow getadrrinfo() to fill in the addrinfo struct with an IP address.
    Wether that be IPv6 or IPv4.
    http://beej.us/guide/bgnet/output/html/singlepage/bgnet.html

    Is a good place to read. Notice this is probably OT here and my question had
    to do with ANSI C.

    Bill
    Bill Cunningham, Apr 15, 2010
    #9
  10. Lew Pitcher wrote:

    > Yes, Bill, those four statements *cannot* stand alone outside a
    > function body.
    >
    > You are going to have to find a way to /put/ them within a function
    > body (your choice of /which/ function body) before your program will
    > compile properly.


    I was using code from
    http://beej.us/guide/bgnet/output/html/singlepage/bgnet.html#bind

    and these members are referred to not in a function. That's what got me.
    They must've been written only as an example.

    Bill
    Bill Cunningham, Apr 15, 2010
    #10
  11. Re: OT English and C (was Re: errors and casting)

    <> wrote in message
    news:...

    > Just sayin'.
    >
    > I guess it might be interesting to know whether there's any correlation
    > between ability to learn a human language (particularly one learned as
    > a first language, as English presumably is for Bill C.) and ability to
    > to express algorithms in a programming language. But to me it doesn't
    > seem obvious that the first would necessarily imply the second.


    I don't like to say this much because I don't like to use it as an
    excuse. But anyway I suffer from some nasty side effects from about 8
    medications. They are getting ready to put me on addarall for fatigue and
    attention deficit or ADD. So I have some trouble getting things finished and
    focusing attention.

    Just thought I'd say this.

    Bill
    Bill Cunningham, Apr 15, 2010
    #11
  12. Re: OT English and C (was Re: errors and casting)

    "Bill Cunningham" <> wrote in message
    news:4bc70d98$0$12433

    > I don't like to say this much because I don't like to use it as an
    > excuse. But anyway I suffer from some nasty side effects from about 8
    > medications. They are getting ready to put me on addarall for fatigue and
    > attention deficit or ADD. So I have some trouble getting things finished
    > and focusing attention.
    >
    > Just thought I'd say this.


    And konopin casues me to not be able to concentrate. I am not able to
    drive now because I can't remember where I'm going or how to get there. In a
    town I've lived in all my life.

    Bill
    Bill Cunningham, Apr 15, 2010
    #12
  13. jacob navia

    Stefan Ram Guest

    Re: OT English and C (was Re: errors and casting)

    <> writes:
    >I guess it might be interesting to know whether there's any correlation
    >between ability to learn a human language (particularly one learned as
    >a first language, as English presumably is for Bill C.) and ability to
    >to express algorithms in a programming language. But to me it doesn't
    >seem obvious that the first would necessarily imply the second.


    »Besides a mathematical inclination, an exceptionally
    good mastery of one's native tongue is the most vital
    asset of a competent programmer.«

    attributed to Djikstra, but I can not confirm the source

    »If your writing is semi-literate, ungrammatical, and
    riddled with misspellings, many hackers (including myself)
    will tend to ignore you. While sloppy writing does not
    invariably mean sloppy thinking, we've generally found the
    correlation to be strong -- and we have no use for sloppy
    thinkers. If you can't yet write competently, learn to.«

    Eric Raymond

    http://www.catb.org/~esr/faqs/hacker-howto.html#skills4

    »I've found that some of the best developers of all are
    English majors. They'll often graduate with no programming
    experience at all, and certainly without a clue about the
    difference between DRAM and EPROM.

    But they can write. That's the art of conveying
    information concisely and clearly. Software development
    and writing are both the art of knowing what you're going
    to do, and then lucidly expressing your ideas.«

    http://praisecurseandrecurse.blogspot.com/2007/03/english-majors-as-programmers.html
    Stefan Ram, Apr 15, 2010
    #13
  14. Re: OT English and C (was Re: errors and casting)

    On 15 Apr, 13:20, <> wrote:
    >
    > Picky speakers of English might point out that "I have went" is, um,
    > "incorrect"?  "non-standard"?
    >

    Stigmatised. Adult speakers don't make grammatical errors in their
    native language, almost by definition.
    Malcolm McLean, Apr 15, 2010
    #14
  15. Re: OT English and C (was Re: errors and casting)

    On 15 Apr, 14:55, Malcolm McLean <>
    wrote:
    > On 15 Apr, 13:20, <> wrote:


    > > Picky speakers of English might point out that "I have went" is, um,
    > > "incorrect"?  "non-standard"?

    >
    > Stigmatised. Adult speakers don't make grammatical errors in their
    > native language, almost by definition.


    I suspect only because you define "native language" as the language he
    speaks grammatically as an adult.
    Nick Keighley, Apr 16, 2010
    #15
  16. jacob navia

    Guest

    Re: OT English and C (was Re: errors and casting)

    In article <4bc70d98$0$12433$>,
    Bill Cunningham <> wrote:
    >
    > <> wrote in message
    > news:...
    >
    > > Just sayin'.
    > >
    > > I guess it might be interesting to know whether there's any correlation
    > > between ability to learn a human language (particularly one learned as
    > > a first language, as English presumably is for Bill C.) and ability to
    > > to express algorithms in a programming language. But to me it doesn't
    > > seem obvious that the first would necessarily imply the second.

    >
    > I don't like to say this much because I don't like to use it as an
    > excuse. But anyway I suffer from some nasty side effects from about 8
    > medications. They are getting ready to put me on addarall for fatigue and
    > attention deficit or ADD. So I have some trouble getting things finished and
    > focusing attention.
    >
    > Just thought I'd say this.
    >


    Just for the record .... I wasn't intending a put-down here, Bill,
    just a nitpicky response to io_x's comment about English. You've
    talked before about all those medications and their side effects.
    It sounds pretty unpleasant, and I guess you have to cope as best
    you can ....

    --
    B. L. Massingill
    ObDisclaimer: I don't speak for my employers; they return the favor.
    , Apr 16, 2010
    #16
  17. Re: English and C

    > "Software development and writing are both
    > the art of knowing what you're going to
    > do, and then lucidly expressing your ideas."


    Software development is more the art of knowing what the computer is
    going to do. (-:
    J de Boyne Pollard, Apr 16, 2010
    #17
  18. Re: English and C

    Am 16.04.2010 19:49, schrieb J de Boyne Pollard:
    >> "Software development and writing are both
    >> the art of knowing what you're going to
    >> do, and then lucidly expressing your ideas."

    >
    > Software development is more the art of knowing what the computer is
    > going to do. (-:


    I think that's not Software development, that's wizardry.

    Joachim
    Joachim Pense, Apr 16, 2010
    #18
  19. Re: English and C

    On 2010-04-16, Joachim Pense <> wrote:
    > Am 16.04.2010 19:49, schrieb J de Boyne Pollard:
    >>> "Software development and writing are both
    >>> the art of knowing what you're going to
    >>> do, and then lucidly expressing your ideas."

    >>
    >> Software development is more the art of knowing what the computer is
    >> going to do. (-:

    >
    > I think that's not Software development, that's wizardry.
    >


    Isn't it both?

    --
    Andrew Poelstra
    http://www.wpsoftware.net/andrew
    Andrew Poelstra, Apr 17, 2010
    #19
  20. Re: OT English and C (was Re: errors and casting)

    On Apr 16, 8:58 am, Nick Keighley <>
    wrote:
    > On 15 Apr, 14:55, Malcolm McLean <>
    > wrote:
    >
    > > On 15 Apr, 13:20, <> wrote:
    > > > Picky speakers of English might point out that "I have went" is, um,
    > > > "incorrect"?  "non-standard"?

    >
    > > Stigmatised. Adult speakers don't make grammatical errors in their
    > > native language, almost by definition.

    >
    > I suspect only because you define "native language" as the language he
    > speaks grammatically as an adult.
    >

    Are the rules applied consistently (eg if he says "can't hardly" is it
    always "can't hardly"), and are they accepted by at least one other
    person (does someone else say "can't hardly")?

    If so he's speaking grammatically.
    Malcolm McLean, Apr 17, 2010
    #20
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mark Goldin

    Errors, errors, errors

    Mark Goldin, Jan 17, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    916
    Mark Goldin
    Jan 17, 2004
  2. kevin
    Replies:
    11
    Views:
    5,782
    Andrew McDonagh
    Jan 8, 2005
  3. SenthilVel
    Replies:
    0
    Views:
    928
    SenthilVel
    Jun 7, 2006
  4. Wally Barnes
    Replies:
    3
    Views:
    508
    Wally Barnes
    Nov 20, 2008
  5. Sosuke

    Up casting and down casting

    Sosuke, Dec 20, 2009, in forum: C++
    Replies:
    2
    Views:
    547
    James Kanze
    Dec 20, 2009
Loading...

Share This Page