Re: Annoying gcc warnings on MacOSX 10.6

Christiaan Hofman <[email protected]> Wed, 17 Aug 2011 18:53:13 +0200
Newsgroups gmane.comp.macosx.devel
Message-ID <[email protected]>
On Aug 17, 2011, at 15:19, Andreas H=F6schler wrote:

> Hi all,
>=20
> when building code like
>=20
>     NSString *message =3D ...
>     [NSException raise:NSInternalInconsistencyException =
format:message];
>=20
> on MacOSX 10.6, gcc give sthe following warning
>=20
> 	SOEditingContext.m:3574: warning: format not a string literal =
and no format arguments
>=20
> Any idea how to get rid of these warnings?
>=20
> Thanks a lot,
>=20
> Andreas

[NSException raise:NSInternalInconsistencyException format:@"%@", =
message];

The "message" can contains %-characters which will lead to (further) =
exceptions/crashes. You may know that it doesn't, but that's not =
relevant, the point is that the compiler doesn't know and you may =
include them by mistake.

Christiaan