From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id B309846B4F for ; Fri, 4 Aug 2023 11:29:10 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id F012968C709; Fri, 4 Aug 2023 14:29:06 +0300 (EEST) Received: from mail-lf1-f41.google.com (mail-lf1-f41.google.com [209.85.167.41]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 91C5A68C06E for ; Fri, 4 Aug 2023 14:28:59 +0300 (EEST) Received: by mail-lf1-f41.google.com with SMTP id 2adb3069b0e04-4fe383c1a26so3463892e87.1 for ; Fri, 04 Aug 2023 04:28:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=martin-st.20221208.gappssmtp.com; s=20221208; t=1691148538; x=1691753338; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=q8mXD4h6yKPBEsMsi9LoksARZhaqF3aU/VA0XOREUc0=; b=pTIg7wtw5fq/sqmFF2TVGwZoVB7jShPSD5BI6jjeFoK49/70biX5S1y3saZnQNVwju jQDjweDOQuarwsMoHyF0RcfmSHs47a/HlJJV+qHvulFeA7IEFXxmDoda76Na6KO+l668 3VT1/nNBTxqI8JN1CXs4L7J1mQJr2yYUMDC9oEx5JQtx/soRkmjP4wOnEkw5l2JoJ5lz cRDM1iFKTISQtYwStrY4aePyx5Hi+vJYrKcBve2KdNpepJ8iHdjhDZ2tnbii15V/K15G ZMbezm8HWEQBp6SvWXI86KGmNQrT3QC431gRie9DjVwvUpHGlH9CoQf5IbOLRSLAKClc 1p6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691148538; x=1691753338; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=q8mXD4h6yKPBEsMsi9LoksARZhaqF3aU/VA0XOREUc0=; b=lc1AyDjqL5wRIX9TuDZKxj7melfyBJKQJyDciU9JtiDtlcIGXOZOs/7rEIztjsMMBk 1kH1c2gxGb3r73rraAVqXR1iQnmSiEPkp4D0oE5DHER/79QEJ/oXyLNHNqrpbuGEyc86 Q/QzesUL/6b0Rd0sPC/skDc0y9QPAjXGX/FmFoDqc1mcf9PKlFFT0EzEjEZkXxda7ARt UEQ71dAxvHKf5Eahz0fNhPaNwOlyZb+EFbgN1TfD6dQhdNWcZuEV6WlV+aHaxmF+bTaI 22prNC2popeC+hmnObj9/pHEV9zgfviDa+mlae4h6A5Y6FBC1ViAD1AQCv7jFxyG+8Hq g4BQ== X-Gm-Message-State: AOJu0YxdAjZDBrM2GpmWQOHytEpsDKRL77mHQjcj5ZUjzXY1cJ1kLBTB jViVn3gA7YmoNzBLWgwVN6AEbd4If1HDghEiUMO0AA== X-Google-Smtp-Source: AGHT+IFkJPOPeuGelGEdwsS/UX3d0mYOVNY+9CtizKKLVCNdn0RtEYEGZ5R8433xgkTcsHsbHbP53w== X-Received: by 2002:a05:6512:3495:b0:4f8:70d8:28f8 with SMTP id v21-20020a056512349500b004f870d828f8mr923738lfr.55.1691148538143; Fri, 04 Aug 2023 04:28:58 -0700 (PDT) Received: from localhost.localdomain (dsl-tkubng21-58c01c-243.dhcp.inet.fi. [88.192.28.243]) by smtp.gmail.com with ESMTPSA id q2-20020ac25282000000b004f864690901sm333189lfm.244.2023.08.04.04.28.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Aug 2023 04:28:57 -0700 (PDT) From: =?UTF-8?q?Martin=20Storsj=C3=B6?= To: ffmpeg-devel@ffmpeg.org Date: Fri, 4 Aug 2023 14:28:56 +0300 Message-Id: <20230804112856.3896010-1-martin@martin.st> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230802070206.28917-1-martin@martin.st> References: <20230802070206.28917-1-martin@martin.st> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v2] intreadwrite: Indicate potential aliasing in AV_RN/AV_WN for Clang/MSVC mode X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: Use the GCC specific codepath for Clang in MSVC mode too. This matches the condition used in a number of other places. MSVC doesn't have a way to signal potential aliasing, while GCC (and Clang) can use __attribute__((may_alias)) for this purpose. When building with Clang in MSVC mode, __GNUC__ isn't defined but _MSC_VER is as Clang primarily impersonates MSVC - but even then it does support the GCC style attributes. The GCC specific codepath uses av_alias, which expands to the may_alias attribute if supported. The MSVC specific codepath doesn't use av_alias so far (as MSVC doesn't support any corresponding attribute). This fixes a couple HEVC decoder tests when built with Clang 14 or newer in MSVC mode (with issues observed on all of x86_64, armv7 and aarch64). --- v2: Changed to just use the GCC specific codepath here, as suggested by Andreas on irc. Will push if there's no objections. --- libavutil/intreadwrite.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavutil/intreadwrite.h b/libavutil/intreadwrite.h index c4679fdba4..21df7887f3 100644 --- a/libavutil/intreadwrite.h +++ b/libavutil/intreadwrite.h @@ -213,7 +213,7 @@ typedef union { * by per-arch headers. */ -#if defined(__GNUC__) +#if defined(__GNUC__) || defined(__clang__) union unaligned_64 { uint64_t l; } __attribute__((packed)) av_alias; union unaligned_32 { uint32_t l; } __attribute__((packed)) av_alias; -- 2.34.1 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".