From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 89102 invoked by alias); 21 May 2018 13:09:05 -0000 Mailing-List: contact libc-help-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Post: List-Help: , Sender: libc-help-owner@sourceware.org Received: (qmail 89084 invoked by uid 89); 21 May 2018 13:09:03 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=in, HX-Received:a0c, H*c:alternative X-HELO: mail-qt0-f182.google.com Received: from mail-qt0-f182.google.com (HELO mail-qt0-f182.google.com) (209.85.216.182) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 21 May 2018 13:09:01 +0000 Received: by mail-qt0-f182.google.com with SMTP id q6-v6so18787620qtn.3 for ; Mon, 21 May 2018 06:09:01 -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:in-reply-to:references:from:date :message-id:subject:to:cc; bh=1k5/7h0vrdOMswH3EJjpoYzGYFW5AadkST6o/Z+LdFs=; b=WOUBLvkzH1d11XmtCaAUMFiH3QsgH8s72LPzCcBMUEpah+dMMOUGdaf28nH+j/Hfft czbXEViNFKT8B3fptrlTVoEzWTo88jrjjrUBmFMLNcWNnB54Y6BRjRf1efX7CFbzf48k S9qvoXERzkSO0kVz33UCF9bBe4DE39p7N8IyFZJF58YxFbdTl3E9tzk+o9pHrMR9wn+O vOHWwaUMDUAfGRt0QOuUqFnN3GlVDTEM7WVJiY4BfvjctEZcJCg+6t0vN0pLJjpSPRbX z9LrYLKUFTgUCZGXBRMCgHXNN7FdkUK32GCO9yedobDFDjvYLJ6alxfwN+Mw4XILkWEk V+oA== X-Gm-Message-State: ALKqPwfA10ZqaFl3fV2ZsnSR89Yo/2sRS3BW6+o8nLK+7AJnXpJPgubJ 6REBDxQh5TiztZ4hl3YfOwjrH0TAQZEUsqXMXE4= X-Google-Smtp-Source: AB8JxZrPIZ5EtTJGFChg2/UAXMyXjWyITgkdr0tURfkWUAsXPMEEqUXvXyyxSP52hQgQnxhBLDhFalWMKXL+N9CM0fY= X-Received: by 2002:a0c:989b:: with SMTP id f27-v6mr17646283qvd.115.1526908139992; Mon, 21 May 2018 06:08:59 -0700 (PDT) MIME-Version: 1.0 Received: by 10.12.232.13 with HTTP; Mon, 21 May 2018 06:08:59 -0700 (PDT) In-Reply-To: References: From: Remus Clearwater Date: Mon, 21 May 2018 13:09:00 -0000 Message-ID: Subject: Fwd: Undefined behaviour code used in sysdeps/unix/sysv/linux/x86_64/makecontext.c To: Godmar Back Cc: libc-help@sourceware.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2018-05/txt/msg00023.txt.bz2 Sorry for forgot to CC libc-help. ---- =E2=80=8BThanks a lot Godmar. But it didn't say `sizeof(function_pointer)` are must equal or less than `sizeof(void*)`. I found this in POSIX.1-2008 http://pubs.opengroup.org/ onlinepubs/9699919799.2008edition/functions/V2_chap02.html#tag_15_12_03: "All function pointer types shall have the same representation as the type pointer to void. Conversion of a function pointer to void * shall not alter the representation. A void * value resulting from such a conversion can be converted back to the original function pointer type, using an explicit cast, without loss of information. Note: The ISO C standard does not require this, but it is required for POSIX conformance." So under POSIX.1-2008 the kinda usage of `function_address =3D (uintptr_t) funcfp;` is correct, but in POSIX.1-2017 this section 2.13.3 has been removed. This means in POSIX.1-2017 that kinda conversition is still not defined.