From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11342 invoked by alias); 20 Mar 2017 18:57:42 -0000 Mailing-List: contact newlib-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: newlib-owner@sourceware.org Received: (qmail 11316 invoked by uid 89); 20 Mar 2017 18:57:41 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.1 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM,SPF_PASS autolearn=no version=3.3.2 spammy=H*f:sk:f43b549, H*i:sk:f43b549 X-HELO: mail-ot0-f179.google.com Received: from mail-ot0-f179.google.com (HELO mail-ot0-f179.google.com) (74.125.82.179) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 20 Mar 2017 18:57:40 +0000 Received: by mail-ot0-f179.google.com with SMTP id x37so138668151ota.2 for ; Mon, 20 Mar 2017 11:57:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc; bh=+4b/XzWqyan4qwrFF5hmp1TZzZLlBCoAhRul0Jpu4Yc=; b=TFa5X80vmUNIrxQ46bu8O/DQ81/nzIq0dJELv3jcp/saZfTnQIFkP/lm83G6D1v6nx gWs4cENMrB8kGVIkUbwVhq0xPzyTefG0hKnEtg2B2depMow3GVztHC86QqiT5Kv1CCBz jn89d05CjWzvwQYVH+dmCV5/HtAGIPgGe4mHVfROyO0WcQgKl3B3+v0JjVeqISMtZi0B hOCR8eHfry8Qsm0sbAaWrrlsbowCCLGUIM7yPkjwucLuoqqGfFTCqeoDeZZ3KkWcCFrN JP4K1ltY9R3ySkIvs+RYW2+/43t4/RG/HYq5skfjK+c+sq8gUR7x81GmICExpYHUeEex rtQA== X-Gm-Message-State: AFeK/H03UzNj7u1fkCUgx5WSfm3RV6m7yaN+3GXfP9spcBOthabpMCDa9ecCfSSwSpXtzXXXAYSITpEIp2sipg== X-Received: by 10.157.19.102 with SMTP id q35mr16796814otq.234.1490036260068; Mon, 20 Mar 2017 11:57:40 -0700 (PDT) MIME-Version: 1.0 Received: by 10.74.31.131 with HTTP; Mon, 20 Mar 2017 11:57:39 -0700 (PDT) Reply-To: noloader@gmail.com In-Reply-To: References: <5952177e-aff7-2653-8977-3295524fdb03@t-online.de> From: Jeffrey Walton Date: Mon, 20 Mar 2017 18:57:00 -0000 Message-ID: Subject: Re: Fwd: Re: free() and implicit conversion to a function pointer (was: Use of initialized variable in strtod.c) To: Eric Blake Cc: newlib@sourceware.org Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2017/txt/msg00200.txt.bz2 >> The reason this is wrong is that C by design treats data and functions >> as living in separate realms, i.e. its virtual machine has a Harvard >> architecture. One of the consequences of this is that pointers to >> functions and pointers to data are incommensurable, i.e. any and all >> conversions or comparisons across this divide are wrong. (void *) are >> compatible to all data pointers, but not to function pointers. > > That's true of strict C99, but not true of POSIX (which adds the > additional requirements above-and-beyond C99 that NULL be equivalent to > ((void*)0) and that any function pointer can be converted to void* and > back without loss of information, in part because of dlsym() and friends). > > Then again, not all newlib targets aim for POSIX compliance, and it is > entirely feasible that someone is trying to use newlib to achieve C99 > compliance without caring about additional POSIX requirements. +1. When I test for compatibility or ST&E, then I will test some stated features even if I don't use them. -std=c99, -ansi and _XOPEN_SOURCE are usually easy enough to test. (Newlib confounds me at the moment, though. I have not figured out an easy way to test it). Jeff