public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* MS_types and addr_t name polution
@ 2002-12-11 20:13 Michael Eager
  0 siblings, 0 replies; 4+ messages in thread
From: Michael Eager @ 2002-12-11 20:13 UTC (permalink / raw)
  To: Cygwin Mailing List

I'm porting a small program to Cygwin.  One of the typedefs
in the program is for a symbol named addr_t.  Since this is
defined in /usr/include/sys/types.h, there is a redefinition
conflict.

This (and a number of other symbols) are defined when __MS_types_
is defined, which, in turn, is defined whenever __CYGWIN__, _WIN32
or __MSDOS__ is defined.  

I don't see any use of addr_t in /usr/include.  Is there a reason
for defining addr_t and the other symbols?


--
Michael Eager     eager@mvista.com	408-328-8426	
MontaVista Software, Inc. 1237 E. Arques Ave., Sunnyvale, CA  94085

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: MS_types and addr_t name polution
  2002-12-12 14:58 ` Michael Eager
@ 2002-12-12 16:40   ` Christopher Faylor
  0 siblings, 0 replies; 4+ messages in thread
From: Christopher Faylor @ 2002-12-12 16:40 UTC (permalink / raw)
  To: cygwin

On Thu, Dec 12, 2002 at 02:22:20PM -0800, Michael Eager wrote:
>Elfyn McBratney wrote:
>>The addr_t type is used in memory managment (memory addresses??) in
>>/usr/include/sys/mman.h.  If you plan on using this (or is already on
>>the code, mman.h i mean) you may have problems.  What is the type of
>>your addr_t?  is it type char of * (pointer)?
>
>Actually, mman.h uses caddr_t, not addr_t, at least in the cygwin
>1.3.15 system I have installed.  Nothing in /usr/include appears to use
>addr_t.
>
>My typedef of addr_t is for 64-bit int.
>
>>If the code is open source you can just change the addr_t typedef name
>>(in your source) to something else eg.  addr2_t in all of your source
>>files (a simple search and replace).
>
>Yes, I renamed all references to addr_t to a different name.  It's just
>a nuisance and appears to be unnecessary name polution.

AFAICT, this header comes from newlib.  Perhaps an inquiry in that
mailing list would be beneficial.

You might also want to think about more creative ways of dealing with
this type of situation than just renaming every occurrence of addr_t.
Like involving macros maybe?  For the record, addr_t is apparently used
on some older UNIX systems.

cgf

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: MS_types and addr_t name polution
  2002-12-12  0:12 Elfyn McBratney
@ 2002-12-12 14:58 ` Michael Eager
  2002-12-12 16:40   ` Christopher Faylor
  0 siblings, 1 reply; 4+ messages in thread
From: Michael Eager @ 2002-12-12 14:58 UTC (permalink / raw)
  To: cygwin

Elfyn McBratney wrote:
> 
> Hi,
> 
> The addr_t type is used in memory managment (memory addresses??) in /usr/include/sys/mman.h. If you plan on using this (or is already on the code, mman.h i mean) you may have problems. What is the type of your addr_t? is it type char of * (pointer)?

Actually, mman.h uses caddr_t, not addr_t, at least in the cygwin 1.3.15
system I have installed.  Nothing in /usr/include appears to use addr_t.

My typedef of addr_t is for 64-bit int.

> If the code is open source you can just change the addr_t typedef name (in your source) to something else eg. addr2_t in all of your source files (a simple search and replace).

Yes, I renamed all references to addr_t to a different name.
It's just a nuisance and appears to be unnecessary name polution.

> 
> Elfyn
> elfyn@exposure.org.uk
> 
> --- Michael Eager <eager@mvista.com> wrote:
> >I'm porting a small program to Cygwin.  One of the typedefs
> >in the program is for a symbol named addr_t.  Since this is
> >defined in /usr/include/sys/types.h, there is a redefinition
> >conflict.
> >
> >This (and a number of other symbols) are defined when __MS_types_
> >is defined, which, in turn, is defined whenever __CYGWIN__, _WIN32
> >or __MSDOS__ is defined.
> >
> >I don't see any use of addr_t in /usr/include.  Is there a reason
> >for defining addr_t and the other symbols?
> >
> >
> >--
> >Michael Eager     eager@mvista.com     408-328-8426
> >MontaVista Software, Inc. 1237 E. Arques Ave., Sunnyvale, CA  94085
> >
> >--
> >Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
> >Bug reporting:         http://cygwin.com/bugs.html
> >Documentation:         http://cygwin.com/docs.html
> >FAQ:                   http://cygwin.com/faq/
> 
> _____________________________________________________________
> www.smokeJet.com - Free UK Internet Services
> 
> _____________________________________________________________
> Select your own custom email address for FREE! Get you@yourchoice.com w/No Ads, 6MB, POP & more! http://www.everyone.net/selectmail?campaign=tag

--
Michael Eager     eager@mvista.com	408-328-8426	
MontaVista Software, Inc. 1237 E. Arques Ave., Sunnyvale, CA  94085

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: MS_types and addr_t name polution
@ 2002-12-12  0:12 Elfyn McBratney
  2002-12-12 14:58 ` Michael Eager
  0 siblings, 1 reply; 4+ messages in thread
From: Elfyn McBratney @ 2002-12-12  0:12 UTC (permalink / raw)
  To: Michael Eager, cygwin

Hi,

The addr_t type is used in memory managment (memory addresses??) in /usr/include/sys/mman.h. If you plan on using this (or is already on the code, mman.h i mean) you may have problems. What is the type of your addr_t? is it type char of * (pointer)?

If the code is open source you can just change the addr_t typedef name (in your source) to something else eg. addr2_t in all of your source files (a simple search and replace).

Elfyn
elfyn@exposure.org.uk

--- Michael Eager <eager@mvista.com> wrote:
>I'm porting a small program to Cygwin.  One of the typedefs
>in the program is for a symbol named addr_t.  Since this is
>defined in /usr/include/sys/types.h, there is a redefinition
>conflict.
>
>This (and a number of other symbols) are defined when __MS_types_
>is defined, which, in turn, is defined whenever __CYGWIN__, _WIN32
>or __MSDOS__ is defined.  
>
>I don't see any use of addr_t in /usr/include.  Is there a reason
>for defining addr_t and the other symbols?
>
>
>--
>Michael Eager     eager@mvista.com	408-328-8426	
>MontaVista Software, Inc. 1237 E. Arques Ave., Sunnyvale, CA  94085
>
>--
>Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
>Bug reporting:         http://cygwin.com/bugs.html
>Documentation:         http://cygwin.com/docs.html
>FAQ:                   http://cygwin.com/faq/

_____________________________________________________________
www.smokeJet.com - Free UK Internet Services

_____________________________________________________________
Select your own custom email address for FREE! Get you@yourchoice.com w/No Ads, 6MB, POP & more! http://www.everyone.net/selectmail?campaign=tag

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2002-12-12 22:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-12-11 20:13 MS_types and addr_t name polution Michael Eager
2002-12-12  0:12 Elfyn McBratney
2002-12-12 14:58 ` Michael Eager
2002-12-12 16:40   ` Christopher Faylor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).