🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.help
Article #51601

Can't compile function using sin as variable

#51601
From: meissner
Date: Fri, 07 May 1993 21:15
43 lines
1945 bytes
| I am having trouble compiling the following small ANSI compliant program:

As RMS points out, this is not an ANSI compliant program (even beyond
the fact that it uses sockets, which aren't in ANSI nor POSIX).

| /* start of program */
| #include <sys/socket.h>
| struct sockaddr_in sin;
| /* end of program */
| 
| The problem is that I get the following error message:
| 
| sin.c:3: built-in function `sin' declared as non-function
| sin.c:3: storage size of `sin' isn't known

	...

| Is there a solution to this problem?

Look into -fno-builtin:

`-fno-builtin'
     Don't recognize built-in functions that do not begin with two
     leading underscores.  Currently, the functions affected include
     `abort', `abs', `alloca', `cos', `exit', `fabs', `ffs', `labs',
     `memcmp', `memcpy', `sin', `sqrt', `strcmp', `strcpy', and
     `strlen'.

     The `-ansi' option prevents `alloca' and `ffs' from being builtin
     functions, since these functions do not have an ANSI standard
     meaning.

Also, you can do:

	-Dsin=xxx_sin

on the command line.

--
Michael Meissner	email: meissner@osf.org		phone: 617-621-8861
Open Software Foundation, 11 Cambridge Center, Cambridge, MA, 02142

You are in a twisty little passage of standards, all conflicting.
Technical Details
Message-ID: <9305072110.AA01415@curley.osf.org>
Path: arc1-ca.pugleaf.net!gmd.de!ira.uka.de!sol.ctr.columbia.edu!howland.reston.ans.net!usenet.ins.cwru.edu!magnus.acs.ohio-state.edu!cis.ohio-state.edu!osf.ORG!meissner
References: meissner@osf.ORG

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 11318c,bd9a44bbdcee8c3f,start
X-Google-Attributes: gid11318c,public
X-Google-ArrivalTime: 1993-05-07 14:36:04 PST
Path: arc1-ca.pugleaf.net!gmd.de!ira.uka.de!sol.ctr.columbia.edu!howland.reston.ans.net!usenet.ins.cwru.edu!magnus.acs.ohio-state.edu!cis.ohio-state.edu!osf.ORG!meissner
From: meissner@osf.ORG
Newsgroups: gnu.gcc.help
Subject: Can't compile function using sin as variable
Date: 7 May 1993 17:15:37 -0400
Organization: GNUs Not Usenet
Lines: 43
Sender: daemon@cis.ohio-state.edu
Distribution: gnu
Message-ID: <9305072110.AA01415@curley.osf.org>
References: meissner@osf.ORG