summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2018-01-28 01:26:49 +0100
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2018-01-28 01:28:08 +0100
commit789a7e7299a580f295d1abd327bb4acf063fd9f0 (patch)
treeefb0b1e43284bb6aa53c56350b2cdb37ee4a0bb9
parentb8874015bd1d09b1b72293c0b5be422fd375e04b (diff)
Fix compilation warnings
Nowadays' compilers are able to recognize memcpy and replace it appropriately without having to tell them so through a structure assignment. That also avoids warnings about type puning. * utils.c (WriteCopyType): Emit memcpy call instead of type-puned assignement.
-rw-r--r--utils.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/utils.c b/utils.c
index d6a2b72..265a123 100644
--- a/utils.c
+++ b/utils.c
@@ -408,12 +408,11 @@ WriteCopyType(FILE *file, const ipc_type_t *it, const char *left,
}
else
{
- fprintf(file, "\t{ typedef struct { char data[%d]; } *sp; * (sp) ",
- it->itTypeSize);
+ fprintf(file, "\tmemcpy(");
do_skip_vfprintf(file, left, right);
- fprintf(file, " = * (sp) ");
+ fprintf(file, ", ");
do_skip_vfprintf(file, right, right);
- fprintf(file, "; }\n");
+ fprintf(file, ", %d);\n", it->itTypeSize);
}
}