aboutsummaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
authortilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2008-12-02 00:37:21 +0000
committertilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2008-12-02 00:37:21 +0000
commitad1d52df72bcc07b11215133217dea1fae1419b1 (patch)
tree36a15e8926ad865d79c9b2dda57bfcb7c4aa42a3 /main
parentf7c1d2a4bc42698f9fe58e9d90e7313ffd27cd89 (diff)
Merged revisions 160207 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r160207 | tilghman | 2008-12-01 18:25:16 -0600 (Mon, 01 Dec 2008) | 3 lines Ensure that Asterisk builds with --enable-dev-mode, even on the latest gcc and glibc. ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@160208 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main')
-rw-r--r--main/cli.c3
-rw-r--r--main/frame.c5
-rw-r--r--main/pbx.c9
3 files changed, 13 insertions, 4 deletions
diff --git a/main/cli.c b/main/cli.c
index 6152867c1..c4ffd392c 100644
--- a/main/cli.c
+++ b/main/cli.c
@@ -1769,7 +1769,8 @@ static int __ast_cli_unregister(struct ast_cli_entry *e, struct ast_cli_entry *e
e->_full_cmd = NULL;
if (e->handler) {
/* this is a new-style entry. Reset fields and free memory. */
- memset((char **)(e->cmda), '\0', sizeof(e->cmda));
+ char *cmda = (char *) e->cmda;
+ memset(cmda, '\0', sizeof(e->cmda));
ast_free(e->command);
e->command = NULL;
e->usage = NULL;
diff --git a/main/frame.c b/main/frame.c
index 35bb47fff..8c0982b8c 100644
--- a/main/frame.c
+++ b/main/frame.c
@@ -478,9 +478,12 @@ struct ast_frame *ast_frdup(const struct ast_frame *f)
memcpy(out->data.ptr, f->data.ptr, out->datalen);
}
if (srclen > 0) {
+ /* This may seem a little strange, but it's to avoid a gcc (4.2.4) compiler warning */
+ char *src;
out->src = buf + sizeof(*out) + AST_FRIENDLY_OFFSET + f->datalen;
+ src = (char *) out->src;
/* Must have space since we allocated for it */
- strcpy((char *)out->src, f->src);
+ strcpy(src, f->src);
}
ast_copy_flags(out, f, AST_FRFLAG_HAS_TIMING_INFO);
out->ts = f->ts;
diff --git a/main/pbx.c b/main/pbx.c
index 974ca6153..1e6ce170e 100644
--- a/main/pbx.c
+++ b/main/pbx.c
@@ -7077,14 +7077,19 @@ int ast_context_add_ignorepat2(struct ast_context *con, const char *value, const
{
struct ast_ignorepat *ignorepat, *ignorepatc, *ignorepatl = NULL;
int length;
+ char *pattern;
length = sizeof(struct ast_ignorepat);
length += strlen(value) + 1;
if (!(ignorepat = ast_calloc(1, length)))
return -1;
/* The cast to char * is because we need to write the initial value.
- * The field is not supposed to be modified otherwise
+ * The field is not supposed to be modified otherwise. Also, gcc 4.2
+ * sees the cast as dereferencing a type-punned pointer and warns about
+ * it. This is the workaround (we're telling gcc, yes, that's really
+ * what we wanted to do).
*/
- strcpy((char *)ignorepat->pattern, value);
+ pattern = (char *) ignorepat->pattern;
+ strcpy(pattern, value);
ignorepat->next = NULL;
ignorepat->registrar = registrar;
ast_wrlock_context(con);