#pragma align before the declaration
When building in usr/src/uts/sun4u/unix with gcc 4.8.2, the following error appears:
../../common/vm/vm_pagelist.c:77:9: error: '#pragma align' must appear before the declaration of vm_cpu_data0, ignoring [-Werror]
#pragma align MAX_PRAGMA_ALIGN(vm_cpu_data0)
cc1: all warnings being treated as errors
The Studio compiler accepts the code with no complaints, but gcc objects to the placement of the pragma. The solution is to use the aligned attribute for the gcc compiler only. I've attached my patch file.
Updated by Gary Mills almost 7 years ago
- Status changed from New to Feedback
I expect that you are right, but your suggestion is testable, at least on the x86 platform. I can only do a build on the SPARC platform, which is only part of the test. Maybe somebody else can assist us.
Updated by Electric Monk over 5 years ago
- Status changed from Feedback to Closed
- % Done changed from 0 to 100
commit 71b4af9b981b0fc179b6c0bab0186b84a2bc2d9c Author: Richard Lowe <firstname.lastname@example.org> Date: 2016-01-31T18:40:17.000Z 5461 #pragma align before the declaration Reviewed by: Robert Mustacchi <email@example.com> Reviewed by: Igor Kozhukhov <firstname.lastname@example.org> Reviewed by: Andrew Stormont <email@example.com> Reviewed by: Garrett D'Amore <firstname.lastname@example.org> Approved by: Dan McDonald <email@example.com>