From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-x32f.google.com (mail-wm1-x32f.google.com [IPv6:2a00:1450:4864:20::32f]) by sourceware.org (Postfix) with ESMTPS id A35893858C52 for ; Sat, 4 Feb 2023 15:03:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A35893858C52 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wm1-x32f.google.com with SMTP id m16-20020a05600c3b1000b003dc4050c94aso5835325wms.4 for ; Sat, 04 Feb 2023 07:03:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=aW6+q+i0VNK3c+hbq4uhj+SPBbyvCUik3S4JqGdaViA=; b=A6F1Ow4jWf8JKkjZ5Ed7wU07fMUMet9JeIa19lXQaDxeOlNEN3lIvkJMj1rmffee3P P5FpxOrx9uJTXSa+nZ7CTSlvfVXGkb1ZV7+hhqJNfzReA2hvqHdfYXoHB0md7Pp7fMcE Kt60IgI4d3FzgSmpF4nmQSVLsbzGMwaiV1LdQIFnbnRXyq/lkymHTrMw0rctIvte6DDY JXmzj+1BwbSIonmEe3B4OTjSGNAacl50oP3A6FOMluLjGeWoljAFoAlgERCLdDQJNcyX a1rGchFgdiaKHZFcayo0O73HxQ7DYXoo3k3L/as3TgDXJM8cYcvVt+ocARh7Hawm1YUS kqpA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=aW6+q+i0VNK3c+hbq4uhj+SPBbyvCUik3S4JqGdaViA=; b=dP1h2TpmI98z2DVwYgN5kyQ/P7tBxyjDxA+3WPg6RWQ0IyAzNfnJPU3IgcqBUJFnHw uKJdi5ixiRsk32M0QsDrWJS5Q7yBfJe+eZ5OJcK43mEJSQZOogGhl2W1DSnJOkx+l9jo i9mFVtfgc0YwHdGUVCsgvXxjBr6v+MTcsAj7/0G3yKiOMJIVIIX5IFf6I0IdF6ZgfmF0 /wlBOjVZB8fn3ouGiI54dko1CEeHOf4Qx63W645h4Ab/cf9tWbboKDiry+jMMvzz9jVI z/AAO5pCwxtkqp9ceTQnezSb8Br6TSPIqjeyuhdJ9sy9LfZcmSEeEWBTwGLXoHRuaV0N OozA== X-Gm-Message-State: AO0yUKVxc61gynltDICGjrQgn4dJXbgEHAEVcn707eoysOb/lXJt+jwS QCd8B3PFcsg2E4k/3iFL9aAe0ksYvGg4O7sjFwYDOpna+Y4= X-Google-Smtp-Source: AK7set+h9jrvnC+3B6nr0lK4JekUalfPCk5ribykhxYuNPvrgx+eXV5KOEwWPA977Mu/7Xpmq4MVtEwQe4QVdwf88v4= X-Received: by 2002:a05:600c:3d8d:b0:3df:f81f:4bdb with SMTP id bi13-20020a05600c3d8d00b003dff81f4bdbmr28314wmb.157.1675522987187; Sat, 04 Feb 2023 07:03:07 -0800 (PST) MIME-Version: 1.0 From: Martin Georgiev Date: Sat, 4 Feb 2023 17:02:56 +0200 Message-ID: Subject: Help with GCC function attributes To: gcc-help@gcc.gnu.org Content-Type: multipart/alternative; boundary="00000000000076e42705f3e11843" X-Spam-Status: No, score=-0.7 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HTML_MESSAGE,KAM_SHORT,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: --00000000000076e42705f3e11843 Content-Type: text/plain; charset="UTF-8" Hi I need clarification about the assume_aligned and malloc function attributes described here: https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html 1) assume_aligned - The description is a bit ambiguous, I assume that an aligned pointer means that the referenced address is aligned and not the pointer itself. Am I correct? 2) malloc - Does the malloc attribute imply that the pointer returned by the function is aligned to the standard malloc alignment or do I have to separately specify an alignment via the assumed_aligned attribute. Thanks in advance. --00000000000076e42705f3e11843--