We should use a signed variable if we subtract and potentially
end up with a negative value.
Additionally, we directly reference these variables so don't
need __attribute__((used)).
Change-Id: I78c2a5706dce9c90595284cf5e1d9d6f6fa1879e
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* be how they get packed and that can be used to iterate the __cmd section
* as well.
*/
-static struct cmd sizer1 __attribute__((used,section("__sizer"))) = {};
-static struct cmd sizer2 __attribute__((used,section("__sizer"))) = {};
+static struct cmd sizer1 __attribute__((section("__sizer"))) = {};
+static struct cmd sizer2 __attribute__((section("__sizer"))) = {};
int main(int argc, char **argv)
{
const struct cmd *cmd = NULL;
/* calculate command size including padding */
- cmd_size = labs((uintptr_t)&sizer2 - (uintptr_t)&sizer1);
+ cmd_size = labs((long)&sizer2 - (long)&sizer1);
/* strip off self */
argc--;
argv0 = *argv++;