Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ethernet API build warnings for LPC4088 #5320

Merged
merged 1 commit into from
Oct 30, 2017

Conversation

kegilbert
Copy link
Contributor

@kegilbert kegilbert commented Oct 13, 2017

LPC4088 ethernet_api build warning fixes to address #5318

Looked like an issue with using a typedef on packed structs in the way it was originally written (https://stackoverflow.com/questions/12213866/is-attribute-packed-ignored-on-a-typedef-declaration).

Does this look reasonable? Tested on a locally exported blinky example for make_armc5. Saw the same warnings as the above issue before moving the PACKED attribute to the end of the struct declaration.

As a quick sanity check I ran the following with and without the PACKED attribute in the struct declaration to confirm the attribute was not silently dropped.

#define MBED_PACKED(struct) struct __attribute__((packed))
#define PACKED MBED_PACKED()

int main(void) {
    struct test {
        unsigned char a;
        unsigned short b;
        unsigned long c;
    } PACKED;

    typedef struct test tTest;

    tTest var1;
    printf("%d\r\n", sizeof(var1));
}

@0xc0170
Copy link
Contributor

0xc0170 commented Oct 17, 2017

LGTM, lets run build only to be certain this is all toolchains compatible

@0xc0170
Copy link
Contributor

0xc0170 commented Oct 19, 2017

/morph build

@0xc0170
Copy link
Contributor

0xc0170 commented Oct 19, 2017

@sarahmarshy review pls

One way to do this also is to use MBED_PACKED that we provide, would that eliminate these warnings?

@mbed-ci
Copy link

mbed-ci commented Oct 19, 2017

Build : SUCCESS

Build number : 256
Build artifacts/logs : http://mbed-os.s3-website-eu-west-1.amazonaws.com/?prefix=builds/5320/

Skipping test trigger, missing label 'NEED CI'

@kegilbert
Copy link
Contributor Author

Should probably switch to MBED_PACKED actually since it looks like PACKED is older, but it just defines back to MBED_PACKED internally:
https://github.com/ARMmbed/mbed-os/blob/master/platform/mbed_toolchain.h#L375

@adbridge
Copy link
Contributor

adbridge commented Oct 24, 2017

@sarahmarshy review pls

BUMP

Copy link
Contributor

@sarahmarshy sarahmarshy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@0xc0170
Copy link
Contributor

0xc0170 commented Oct 24, 2017

/morph test

@mbed-ci
Copy link

mbed-ci commented Oct 24, 2017

@adbridge
Copy link
Contributor

Should probably switch to MBED_PACKED actually since it looks like PACKED is older, but it just defines back to MBED_PACKED internally:
https://github.com/ARMmbed/mbed-os/blob/master/platform/mbed_toolchain.h#L375

@kegilbert Are you proposing to make a change still on this PR then ?

…. Placement of packed attribute was causing warnings due to following typedef
@kegilbert
Copy link
Contributor Author

@adbridge I just updated the PR, I was going to gauge if anyone had thoughts on it first. Decided to change it to MBED_PACKED since I'd seen it used a bit more in mbed_toolchain and some filesystem implementations.

@0xc0170
Copy link
Contributor

0xc0170 commented Oct 26, 2017

/morph build

@mbed-ci
Copy link

mbed-ci commented Oct 26, 2017

Build : FAILURE

Build number : 348
Build artifacts/logs : http://mbed-os.s3-website-eu-west-1.amazonaws.com/?prefix=builds/5320/

@studavekar
Copy link
Contributor

studavekar commented Oct 26, 2017

Please ignore the failure #5320 (comment) , plugin triggered the build twice.

@mbed-ci
Copy link

mbed-ci commented Oct 26, 2017

Build : SUCCESS

Build number : 349
Build artifacts/logs : http://mbed-os.s3-website-eu-west-1.amazonaws.com/?prefix=builds/5320/

Triggering tests

/morph test
/morph uvisor-test

@mbed-ci
Copy link

mbed-ci commented Oct 26, 2017

@kegilbert kegilbert deleted the fix-build-warnings-lpc4088 branch October 30, 2017 16:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants