This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Documentation error in [5.47 Built-in functions for atomic memory access]


In section "5.47 Built-in functions for atomic memory access", both "nand" examples show incorrect code in their second lines.

Incorrect:

????????? { tmp = *ptr; *ptr op= value; return tmp; }
????????? { tmp = *ptr; *ptr = ~tmp & value; return tmp; }?? // nand


Correct (move the "~" in 2nd line):

????????? { tmp = *ptr; *ptr op= value; return tmp; }
????????? { tmp = *ptr; *ptr = tmp & ~value; return tmp; }?? // nand

?
Incorrect:

????????? { *ptr op= value; return *ptr; }
????????? { *ptr = ~*ptr & value; return *ptr; }?? // nand

Correct (move the "~" in 2nd line):

????????? { *ptr op= value; return *ptr; }
????????? { *ptr = *ptr & ~value; return *ptr; }?? // nand

p.s. I looked all over the place for the proper way to report a documentation error, and was unable to find anything helpful.? Perhaps the manual itself ought to point out where to report such.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]