structure paddind

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • amit

    structure paddind

    how to stop or change structure padding ???
  • Chris Dollin

    #2
    Re: structure paddind

    amit wrote:
    how to stop or change structure padding ???
    (a) See your local implementation manual for the implementation-specific
    way to do this.

    (b, preferred if plausible) Write your code so that it doesn't care about
    structure padding even if there is any.

    Why do you think you want to stop or change structure padding?

    --
    "Well begun is half done." - Proverb

    Hewlett-Packard Limited Cain Road, Bracknell, registered no:
    registered office: Berks RG12 1HN 690597 England

    Comment

    • jacob navia

      #3
      Re: structure paddind

      Chris Dollin wrote:
      amit wrote:
      >
      >how to stop or change structure padding ???
      >
      (a) See your local implementation manual for the implementation-specific
      way to do this.
      >
      (b, preferred if plausible) Write your code so that it doesn't care about
      structure padding even if there is any.
      >
      Why do you think you want to stop or change structure padding?
      >
      We had a discussion about the

      #pragma pack

      construct in this group several weeks ago. Google for it, since
      we gave a detailed discussion about that construct in many different
      situations and compilers

      --
      jacob navia
      jacob at jacob point remcomp point fr
      logiciels/informatique

      Comment

      • CBFalconer

        #4
        Re: structure paddind

        jacob navia wrote:
        Chris Dollin wrote:
        >amit wrote:
        >>
        >>how to stop or change structure padding ???
        >>
        >(a) See your local implementation manual for the
        > implementation-specific way to do this.
        >>
        >(b, preferred if plausible) Write your code so that it doesn't
        > care about structure padding even if there is any.
        >>
        >Why do you think you want to stop or change structure padding?
        >
        We had a discussion about the #pragma pack construct in this
        group several weeks ago. Google for it, since we gave a detailed
        discussion about that construct in many different situations and
        compilers
        Once more, Jacob is off-topic and not portable. See the following
        extract from N869:

        6.10.6 Pragma directive

        Semantics

        [#1] A preprocessing directive of the form

        # pragma pp-tokens-opt new-line

        where the preprocessing token STDC does not immediately
        follow pragma in the directive (prior to any macro
        replacement)136 ) causes the implementation to behave in an
        implementation-defined manner. The behavior might cause
        translation to fail or cause the translator or the resulting
        program to behave in a non-conforming manner. Any such
        pragma that is not recognized by the implementation is
        ignored.

        _______________ _____

        136An implementation is not required to perform macro
        replacement in pragmas, but it is permitted except for in
        standard pragmas (where STDC immediately follows pragma).
        If the result of macro replacement in a non-standard
        pragma has the same form as a standard pragma, the
        behavior is still implementation-defined; an
        implementation is permitted to behave as if it were the
        standard pragma, but is not required to.


        [#2] If the preprocessing token STDC does immediately follow
        pragma in the directive (prior to any macro replacement),
        then no macro replacement is performed on the directive, and
        the directive shall have one of the following forms whose
        meanings are described elsewhere:

        #pragma STDC FP_CONTRACT on-off-switch
        #pragma STDC FENV_ACCESS on-off-switch
        #pragma STDC CX_LIMITED_RANG E on-off-switch

        on-off-switch: one of
        ON OFF DEFAULT

        --
        [mail]: Chuck F (cbfalconer at maineline dot net)
        [page]: <http://cbfalconer.home .att.net>
        Try the download section.


        --
        Posted via a free Usenet account from http://www.teranews.com

        Comment

        • Richard Tobin

          #5
          Re: structure paddind

          In article <874pblulqv.fsf @kvetch.smov.or g>,
          Keith Thompson <kst-u@mib.orgwrote:
          >Using #pragma pack might turn out to be the perfect solution to the
          >OP's problem, but recommending it without even mentioning the caveats
          >is irresponsible.
          He pointed the poster to a previous discussion of it. Does he have
          to repeat it all too?

          -- Richard
          --
          :wq

          Comment

          • jacob navia

            #6
            Re: structure paddind

            Richard Tobin wrote:
            In article <874pblulqv.fsf @kvetch.smov.or g>,
            Keith Thompson <kst-u@mib.orgwrote:
            >
            >Using #pragma pack might turn out to be the perfect solution to the
            >OP's problem, but recommending it without even mentioning the caveats
            >is irresponsible.
            >
            He pointed the poster to a previous discussion of it. Does he have
            to repeat it all too?
            >
            -- Richard
            It was a deep discussion with pros, cons, examples
            from weird architectures, etc. I did not recommend anything
            I just pointed to that discussion, as you say.

            --
            jacob navia
            jacob at jacob point remcomp point fr
            logiciels/informatique

            Comment

            Working...