Re: [xml] libxml2 API crazy?
- From: Nikita Churaev <lamefun x0r gmail com>
- To: Nikolay Sivov <bunglehead gmail com>
- Cc: xml gnome org
- Subject: Re: [xml] libxml2 API crazy?
- Date: Mon, 29 Apr 2013 08:32:22 +0400
It doesn't have anything to do with C standard.
It does. Take for example:
struct A {
int q;
int w;
/* end of common part */
float x;
};
struct B {
int q;
int w;
/* end of common part */
double x;
};
What if the C standard allows the compiler to place q and w further
apart in struct A than in struct B? Then if you cast struct A *a into
struct B *b, you'll get garbage in b->w.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]