• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
RE: Finding typecasts
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Finding typecasts


  • Subject: RE: Finding typecasts
  • From: Arvan Pritchard <email@hidden>
  • Date: Wed, 19 Aug 2009 02:08:43 -0700
  • Acceptlanguage: en-US
  • Thread-topic: Finding typecasts

In C++, you can search for C++ casts (reinterpret_cast in this case) with regular expressions, and you can find C casts with -Wold-style-cast, but there may be too many of them.

You could try compiling C code as C++ with this warning on but you'd probably get too many errors.

I don't know what you can do with constructor's though - e.g.

void *p;
...
int i(p);
int j = int(p);

Arvan

> -----Original Message-----
> From: xcode-users-
> bounces+arvan.pritchard=email@hidden [mailto:xcode-
> users-bounces+arvan.pritchard=email@hidden] On
> Behalf Of Paul M
> Sent: Tuesday, August 18, 2009 11:54 PM
> To: Mark Wagner
> Cc: XCode Users
> Subject: Re: Finding typecasts
>
> In a terminal shell:
>  > grep -Hn '(pointer)' source1.c > lines_to_fix
>  > grep -Hn '(int)' source1.c >> lines_to_fix
>  > grep -Hn '(pointer)' source2.c >> lines_to_fix
>  > grep -Hn '(int)' source2.c >> lines_to_fix
> ...
>
> or some variation thereof may work, depending on how it was done.
>
>
> paulm
>
>
>
> On 19/08/2009, at 9:09 AM, Mark Wagner wrote:
>
> > How can I find every line of a C program where a pointer is cast to
> an
> > integer, or vice-versa?  I've got a library where the original author
> > treated pointers and integers as being the same thing, and I'm trying
> > to sort it out.
> >
> > Thanks,
> > Mark Wagner
>
>  _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Xcode-users mailing list      (email@hidden)
> Help/Unsubscribe/Update your Subscription:
> users/email@hidden
>
> This email sent to email@hidden


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Finding typecasts (From: Mark Wagner <email@hidden>)
 >Re: Finding typecasts (From: Paul M <email@hidden>)

  • Prev by Date: Re: Added Framework has a Configuration (Release/Debug) ?
  • Next by Date: Re: Recommendations for strip(1)? Was: gdb: "No line number info...."
  • Previous by thread: Re: Finding typecasts
  • Next by thread: Added Framework has a Configuration (Release/Debug) ?
  • Index(es):
    • Date
    • Thread