error

B

Bill Cunningham

I received this error and can't figure it out so I thought I would post
it. This has to do with posix and I guess it would fit under standard C.

#include <stdio.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>

struct addrinfo sin, *psin;

int pass(void)
{
sin.ai_family = PF_INET;
sin.ai_socktype = SOCK_STREAM;
sin.ai_protocol = 0;
sin.ai_flags = AF_PASSIVE;
}

pass.c:6: warning: built-in function 'sin' declared as non-function
pass.c: In function `pass':
pass.c:13: error: `AF_PASSIVE' undeclared (first use in this function)
pass.c:13: error: (Each undeclared identifier is reported only once
pass.c:13: error: for each function it appears in.)

It looks to me like some macros are out of scope. I'm using the headers
I am supposed to. I believe I am following directions properly. As per this
site where I'm learning but writing my own code.
http://beej.us/guide/bgnet/output/html/singlepage/bgnet.html

Bill
 
B

Bill Cunningham

Bill Cunningham wrote:

Should I not have put this in a function? Is that why things are out of
scope?

Bill
 
I

Igmar Palsenberg

I received this error and can't figure it out so I thought I would post
it. This has to do with posix and I guess it would fit under standard C.

#include<stdio.h>
#include<sys/types.h>
#include<sys/socket.h>
#include<netdb.h>

struct addrinfo sin, *psin;

int pass(void)
{
sin.ai_family = PF_INET;
sin.ai_socktype = SOCK_STREAM;
sin.ai_protocol = 0;
sin.ai_flags = AF_PASSIVE;
}

pass.c:6: warning: built-in function 'sin' declared as non-function
pass.c: In function `pass':
pass.c:13: error: `AF_PASSIVE' undeclared (first use in this function)
pass.c:13: error: (Each undeclared identifier is reported only once
pass.c:13: error: for each function it appears in.)

It looks to me like some macros are out of scope. I'm using the headers
I am supposed to. I believe I am following directions properly. As per this
site where I'm learning but writing my own code.
http://beej.us/guide/bgnet/output/html/singlepage/bgnet.html

Read the page again. Then read it again, it's AI_PASSIVE, not AF_PASSIVE.



Igmar
 
B

Bill Cunningham

Read the page again. Then read it again, it's AI_PASSIVE, not AF_PASSIVE.

Oh yes.. I saw that error finally but I am compiling the code now but I
am getting a waring concerning the

struct addrinfo sin,*psin;

line. Something about not a function? Maybe I should just ignore it but I
hate to there must be something triggering this warning.

Bill
 
J

jacob navia

Bill Cunningham a écrit :
[snip code]

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

Igmar Palsenberg

Oh yes.. I saw that error finally but I am compiling the code now but I
am getting a waring concerning the

struct addrinfo sin,*psin;

line. Something about not a function? Maybe I should just ignore it but I
hate to there must be something triggering this warning.

sin is a build-in function.



Igmar
 
J

jacob navia

Bill Cunningham a écrit :
Bill Cunningham wrote:

Should I not have put this in a function? Is that why things are out of
scope?

Bill
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.
 
B

Bill Cunningham

Igmar said:
sin is a build-in function.

Thanks for your help Igmar I will try to sort as much of this posix out
as I can and if I have a problem I'll call back. :)

Bill
 
I

Ian Collins

Bill Cunningham a écrit :
[snip code]

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.

He's been at it recently on c.u.p as well.
 
R

Richard Bos

jacob navia said:
Bill Cunningham a écrit :
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.

Nonsense, and you bloody well know it. He's asking them of _C_
programmers now, not in any way specifically of 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,

This, however, remains as true as it has always been.

Richard
 
J

J de Boyne Pollard

The truth is that you were "studying sockets" six years ago in
He's been at it recently on c.u.p as well.

That's in fact what led me to post in comp.unix.programmer
what M. navia was quoting there. (-:
 
J

jacob navia

J de Boyne Pollard a écrit :
That's in fact what led me to post in comp.unix.programmer
what M. navia was quoting there. (-:

Yes but the message had no attributions, sorry.

My objective was to stop this guy from going on and on...
Note that he did NOT answer any of the several messages I sent
with the same text in the different threads he started.

jacob
 
J

J de Boyne Pollard

He's been at it recently on c.u.p as well.
Yes but the message had no attributions, sorry.

No worries. I didn't mind. I was just killing two birds
with one post, clueing M. Bos in at the same time.
My objective was to stop this guy from going on and on...

This wouldn't be the first time that a post of mine has
been used in such a way. You probably won't stop Bill
Cunningham from posting, but with an improved canned
response, that doesn't confuse as M. Bos was confused
here, you can probably stop people falling for it.
Note that he did NOT answer any of the several messages I sent
with the same text in the different threads he started.

Xe answered the original, asking us to continue to believe
that xe *really is* Bill Cunningham, Worst Programmer
In The World. We all ignored it, because we've caught
wise. (-:
 
C

Chad

No worries.  I didn't mind.  I was just killing two birds
with one post, clueing M. Bos in at the same time.


This wouldn't be the first time that a post of mine has
been used in such a way.  You probably won't stop Bill
Cunningham from posting, but with an improved canned
response, that doesn't confuse as M. Bos was confused
here, you can probably stop people falling for it.


Xe answered the original, asking us to continue to believe
that xe *really is* Bill Cunningham, Worst Programmer
In The World.  We all ignored it, because we've caught
wise.  (-:

There is a guy I know from another forum, who after 10 years of
*professional* programming with C and Perl, still confuses 5 and "5"
when it comes to C. My personal favorite comment from him was he he
tried to tell me that compiler warnings are meaningless.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,067
Latest member
HunterTere

Latest Threads

Top