Changeset 6337cb5


Ignore:
Timestamp:
Oct 20, 2009, 1:28:57 AM (15 years ago)
Author:
Anders Kaseorg <andersk@mit.edu>
Branches:
master, release-1.10, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
Children:
99525be
Parents:
68f358c
git-author:
Anders Kaseorg <andersk@mit.edu> (10/19/09 23:27:28)
git-committer:
Anders Kaseorg <andersk@mit.edu> (10/20/09 01:28:57)
Message:
Reimplement zstr with a union, to shut up gcc -Wcast-qual.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
File:
1 edited

Legend:

Unmodified
Added
Removed
  • owl.h

    r4f2166b r6337cb5  
    193193
    194194#ifdef HAVE_LIBZEPHYR
    195 /* libzephyr doesn't use const, so we appease the type system with this cast. */
     195/* libzephyr doesn't use const, so we appease the type system with this kludge.
     196 * This just casts const char * to char * in a way that doesn't yield a warning
     197 * from gcc -Wcast-qual. */
    196198static inline char *zstr(const char *str)
    197199{
    198   return (char *)str;
     200  union { char *rw; const char *ro; } u;
     201  u.ro = str;
     202  return u.rw;
    199203}
    200204#endif
Note: See TracChangeset for help on using the changeset viewer.