[Ovmsdev] Compiler warning

Mark Webb-Johnson mark at webb-johnson.net
Thu Jun 28 08:05:38 HKT 2018


> where does your -Wstrict-aliasing option come from?

No idea. I don’t see that on the gcc command line.

Maybe there in debug or release builds? (I see a comment in the documentation about it being triggered by an optimization level of -O2 or higher or -Os)

Regards, Mark.

> On 28 Jun 2018, at 2:54 AM, Michael Balzer <dexter at expeedo.de> wrote:
> 
> I always eliminate all warnings in my code, and I don't get any warning now. Mark, where does your -Wstrict-aliasing option come from? My build doesn't set that.
> 
> The warning makes sense though → fixed.
> 
> Regards,
> Michael
> 
> 
> Am 27.06.2018 um 07:56 schrieb Mark Webb-Johnson:
>> I’m seeing this:
>> 
>> CXX build/ovms_webserver/src/ovms_webserver.o
>> /Users/mark/Documents/ovms/Open-Vehicle-Monitoring-System-3.1/vehicle/OVMS.V3/components/ovms_webserver/src/ovms_webserver.cpp: In member function 'user_session* OvmsWebServer::CreateSession(const http_message*)':
>> /Users/mark/Documents/ovms/Open-Vehicle-Monitoring-System-3.1/vehicle/OVMS.V3/components/ovms_webserver/src/ovms_webserver.cpp:665:32: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
>>    s->id = *((uint64_t *) digest);
>>                                 ^
>> Michael: Can you have a look?
>> 
>> Thanks, Mark.
>> 
>> 
>> 
>> _______________________________________________
>> OvmsDev mailing list
>> OvmsDev at lists.openvehicles.com <mailto:OvmsDev at lists.openvehicles.com>
>> http://lists.openvehicles.com/mailman/listinfo/ovmsdev <http://lists.openvehicles.com/mailman/listinfo/ovmsdev>
> 
> -- 
> Michael Balzer * Helkenberger Weg 9 * D-58256 Ennepetal
> Fon 02333 / 833 5735 * Handy 0176 / 206 989 26
> _______________________________________________
> OvmsDev mailing list
> OvmsDev at lists.openvehicles.com
> http://lists.openvehicles.com/mailman/listinfo/ovmsdev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openvehicles.com/pipermail/ovmsdev/attachments/20180628/3b771f3e/attachment.htm>


More information about the OvmsDev mailing list