Compilation Warnings on OS X 10.5
authorAndrew MacIsaac <macisaac.andrew@gmail.com>
Wed, 29 Dec 2010 20:15:48 +0000 (12:15 -0800)
committerØyvind Harboe <oyvind.harboe@zylin.com>
Wed, 29 Dec 2010 21:16:28 +0000 (22:16 +0100)
I received a number of "-Wshadow" related warnings (treated as errors) while
trying to build on OS X Leopard.  In addition, there were two miscellaneous
other warnings in the flash drivers.  Attached are two patches which correct
these issues and the commit messages to accompany them.

My system has the following configuration (taken from uname -a):

Darwin 9.8.0 Darwin Kernel Version 9.8.0: Wed Jul 15 16:55:01 PDT 2009;
root:xnu-1228.15.4~1/RELEASE_I386 i386

=== Werror_patch.txt Commit Message ===
compilation: fixes for -Wshadow warnings on OS X

These changes fix -Wshadow compilation warnings on OS X 10.5.8

Compiled with the following configure command:

../configure --prefix=/usr/local --enable-maintainer-mode --enable-jlink
--enable-ft2232_libftdi

=== flash_patch.txt Commit Message ===
compilation: fixes for flash driver warnings on OS X

These changes fix two compilation warnings on OS X 10.5.8:

../../../../src/flash/nor/at91sam3.c:2767: warning: redundant redeclaration
of 'at91sam3_flash'
../../../../src/flash/nor/at91sam3.c:101: warning: previous declaration of
'at91sam3_flash' was here

and

../../../../src/flash/nor/stmsmi.c:205: warning: format not a string literal
and no format arguments

Compiled with the following configure command:

../configure --prefix=/usr/local --enable-maintainer-mode --enable-jlink
--enable-ft2232_libftdi
===

Andrew

src/flash/nor/lpc2900.c
src/flash/nor/stmsmi.c
src/helper/fileio.h
src/openocd.c
src/target/arm_dpm.h
src/target/mips32_pracc.h
src/target/mips_ejtag.h
src/target/target.c

index 1c1c90fd91df20275f021452990d21310fe93506..7bb9f141b28a9310b327b180ae13ca5b0a72753a 100644 (file)
@@ -184,7 +184,7 @@ static uint32_t lpc2900_run_bist128(struct flash_bank *bank,
                                     uint32_t addr_from, uint32_t addr_to,
                                     uint32_t (*signature)[4] );
 static uint32_t lpc2900_address2sector(struct flash_bank *bank, uint32_t offset);
-static uint32_t lpc2900_calc_tr( uint32_t clock, uint32_t time );
+static uint32_t lpc2900_calc_tr(uint32_t clock_var, uint32_t time_var);
 
 
 /***********************  Helper functions  **************************/
index c9a16726ffc167a282a4bdd44384008eb1a595a8..d298b36803b7ff3016314df076cf3850cd9a854d 100644 (file)
@@ -202,7 +202,7 @@ FLASH_BANK_COMMAND_HANDLER(stmsmi_flash_bank_command)
 {
        struct stmsmi_flash_bank *stmsmi_info;
 
-       LOG_DEBUG(__FUNCTION__);
+       LOG_DEBUG("%s", __FUNCTION__);
 
        if (CMD_ARGC < 6)
        {
index fa499ab7d8b0fca34542f2862228f3e6dc6e477e..f37dbd14b6d02c1f194335d4bf11f2eedabb420f 100644 (file)
@@ -53,7 +53,7 @@ struct fileio
 };
 
 int fileio_open(struct fileio *fileio,
-       const char *url, enum fileio_access access, enum fileio_type type);
+       const char *url, enum fileio_access access_type, enum fileio_type type);
 int fileio_close(struct fileio *fileio);
 
 int fileio_seek(struct fileio *fileio, size_t position);
index 109f0e198e25feffd77d96a5af5089c935bb7f2a..62b22389a9b68fe2fa7d2de6992840ab9043b518 100644 (file)
@@ -267,7 +267,7 @@ struct command_context *setup_command_handler(Jim_Interp *interp)
        struct command_context *cmd_ctx = command_init(startup, interp);
 
        /* register subsystem commands */
-       typedef int (*command_registrant_t)(struct command_context *cmd_ctx);
+       typedef int (*command_registrant_t)(struct command_context *cmd_ctx_value);
        static const command_registrant_t command_registrants[] = {
                &openocd_register_commands,
                &server_register_commands,
index 5d75ed4121f5730bada76e060a590b8d821eb658..e180807fe68a0a8299206310c6f0bf00de8b5d04 100644 (file)
@@ -100,7 +100,7 @@ struct arm_dpm {
         * must currently be disabled.  Indices 0..15 are used for
         * breakpoints; indices 16..31 are for watchpoints.
         */
-       int (*bpwp_enable)(struct arm_dpm *, unsigned index,
+       int (*bpwp_enable)(struct arm_dpm *, unsigned index_value,
                        uint32_t addr, uint32_t control);
 
        /**
@@ -108,7 +108,7 @@ struct arm_dpm {
         * hardware control registers.  Indices are the same ones
         * accepted by bpwp_enable().
         */
-       int (*bpwp_disable)(struct arm_dpm *, unsigned index);
+       int (*bpwp_disable)(struct arm_dpm *, unsigned index_value);
 
        /* The breakpoint and watchpoint arrays are private to the
         * DPM infrastructure.  There are nbp indices in the dbp
index f2c268009a47bbb0cba9f94fa9e1783ba47ef39a..b207a5be568aca0499e5ef1034354ab16a0b7ddb 100644 (file)
@@ -45,7 +45,7 @@ int mips32_pracc_read_mem(struct mips_ejtag *ejtag_info,
 int mips32_pracc_write_mem(struct mips_ejtag *ejtag_info,
                uint32_t addr, int size, int count, void *buf);
 int mips32_pracc_fastdata_xfer(struct mips_ejtag *ejtag_info, struct working_area *source,
-               int write, uint32_t addr, int count, uint32_t *buf);
+               int write_t, uint32_t addr, int count, uint32_t *buf);
 
 int mips32_pracc_read_regs(struct mips_ejtag *ejtag_info, uint32_t *regs);
 int mips32_pracc_write_regs(struct mips_ejtag *ejtag_info, uint32_t *regs);
index 694cb34479585b580298e18536ea421244fdf772..a4430b6e9c8fca5e4fce9f468d0e4f61c738a374 100644 (file)
@@ -137,7 +137,7 @@ int mips_ejtag_exit_debug(struct mips_ejtag *ejtag_info);
 int mips_ejtag_get_idcode(struct mips_ejtag *ejtag_info, uint32_t *idcode);
 int mips_ejtag_drscan_32(struct mips_ejtag *ejtag_info, uint32_t *data);
 int mips_ejtag_drscan_8(struct mips_ejtag *ejtag_info, uint32_t *data);
-int mips_ejtag_fastdata_scan(struct mips_ejtag *ejtag_info, int write, uint32_t *data);
+int mips_ejtag_fastdata_scan(struct mips_ejtag *ejtag_info, int write_t, uint32_t *data);
 
 int mips_ejtag_init(struct mips_ejtag *ejtag_info);
 int mips_ejtag_config_step(struct mips_ejtag *ejtag_info, int enable_step);
index ba7aa5767355b2e17cf0cc10a6375ef876e3eae3..a9bb8e8502966320d1c3c3d2da34b4b2e6b992ac 100644 (file)
@@ -2314,7 +2314,7 @@ COMMAND_HANDLER(handle_md_command)
 
        bool physical=strcmp(CMD_ARGV[0], "phys")==0;
        int (*fn)(struct target *target,
-                       uint32_t address, uint32_t size, uint32_t count, uint8_t *buffer);
+                       uint32_t address, uint32_t size_value, uint32_t count, uint8_t *buffer);
        if (physical)
        {
                CMD_ARGC--;

Linking to existing account procedure

If you already have an account and want to add another login method you MUST first sign in with your existing account and then change URL to read https://review.openocd.org/login/?link to get to this page again but this time it'll work for linking. Thank you.

SSH host keys fingerprints

1024 SHA256:YKx8b7u5ZWdcbp7/4AeXNaqElP49m6QrwfXaqQGJAOk gerrit-code-review@openocd.zylin.com (DSA)
384 SHA256:jHIbSQa4REvwCFG4cq5LBlBLxmxSqelQPem/EXIrxjk gerrit-code-review@openocd.org (ECDSA)
521 SHA256:UAOPYkU9Fjtcao0Ul/Rrlnj/OsQvt+pgdYSZ4jOYdgs gerrit-code-review@openocd.org (ECDSA)
256 SHA256:A13M5QlnozFOvTllybRZH6vm7iSt0XLxbA48yfc2yfY gerrit-code-review@openocd.org (ECDSA)
256 SHA256:spYMBqEYoAOtK7yZBrcwE8ZpYt6b68Cfh9yEVetvbXg gerrit-code-review@openocd.org (ED25519)
+--[ED25519 256]--+
|=..              |
|+o..   .         |
|*.o   . .        |
|+B . . .         |
|Bo. = o S        |
|Oo.+ + =         |
|oB=.* = . o      |
| =+=.+   + E     |
|. .=o   . o      |
+----[SHA256]-----+
2048 SHA256:0Onrb7/PHjpo6iVZ7xQX2riKN83FJ3KGU0TvI0TaFG4 gerrit-code-review@openocd.zylin.com (RSA)