Path: csiph.com!news.mixmin.net!border2.nntp.ams1.giganews.com!nntp.giganews.com!buffer2.nntp.ams1.giganews.com!nntp.brightview.co.uk!news.brightview.co.uk.POSTED!not-for-mail NNTP-Posting-Date: Thu, 16 Nov 2017 13:20:18 -0600 From: Gareth Owen Newsgroups: comp.lang.c Subject: Re: Equal yet different pointers References: <87k1yqyxgx.fsf@kst-u.example.com> Date: Thu, 16 Nov 2017 19:20:18 +0000 Message-ID: <8760aaav4d.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) Cancel-Lock: sha1:N6MU6eHXYzyMmacc+SSLKk/fYLI= MIME-Version: 1.0 Content-Type: text/plain Lines: 16 X-Usenet-Provider: http://www.giganews.com X-Trace: sv3-3H5DV6txpyT+VbORwi2QQdJdoTf0Pa/3HiUZBqcSzdlySha+EiD77Addq6Kl8uVQMxhouki8ZKoZ/bK!h19mh0VTQmr7y/8VA/b57dsj2Aw/FA0igH6HhbtASq4PUXRTxxrrk+edZoPiKdmyN+nOPg== X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 X-Original-Bytes: 1842 Xref: csiph.com comp.lang.c:122749 Keith Thompson writes: >> gcc /does/ do something wrong here - it accepts this program without >> warnings, even with -Wall -Wextra. So I do have something to complain >> about here with gcc. > > Why do you expect a warning? There may or may not be undefined > behavior, but as far as I can tell no diagnostic is required. Because some people have expectations that extend beyond the C standard? I appreciate that the holy standard (peace be upon it) is your sole point of reference in all things, but most people quite like that GCC sometimes give diagnostics for dangerous or undefined constructs, even when the standard says they're not required. Its not unreasonable to expect one in a trivial case of UB like this.