Skip to content

Commit eac2d7e

Browse files
author
Yang, Xiao
committed
[build-rules] fix -fuse-linker-plugin warnings when build mk3060
Signed-off-by: Yang, Xiao <[email protected]>
1 parent 5efd158 commit eac2d7e

File tree

4 files changed

+15
-6
lines changed

4 files changed

+15
-6
lines changed

build-rules/_rules-top.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,7 @@ clean:
171171
-or -name "*.o" \
172172
-or -name "*.d" \
173173
-or -name "*.gc*" \
174+
| grep -v '$(OUTPUT_DIR)/compiler' \
174175
2>/dev/null)
175176

176177
distclean:

build-rules/funcs.mk

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,9 @@ define Brief_Log
5454
elif [ "$1" = "ST" ]; then \
5555
COLOR_MARK="\033[0;33m"; \
5656
fi; \
57-
echo -ne "$${COLOR_MARK}"; \
57+
if [ "$(PLAIN_LOG)" != "1" ]; then \
58+
echo -ne "$${COLOR_MARK}"; \
59+
fi; \
5860
if [ "$2" = "" ]; then \
5961
FIRST_DEP="$(firstword $(filter-out FORCE,$?))"; \
6062
SPACE_BAR=" "; \
@@ -72,7 +74,9 @@ define Brief_Log
7274
fi \
7375
done; \
7476
fi; \
75-
echo -ne "\033[0m"; \
77+
if [ "$(PLAIN_LOG)" != "1" ]; then \
78+
echo -ne "\033[0m"; \
79+
fi; \
7680
)
7781
endef
7882

src/protocol/mqtt/client/mqtt_client.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3084,7 +3084,8 @@ void *IOT_MQTT_Construct(iotx_mqtt_param_t *pInitParams)
30843084
}
30853085

30863086
if (pInitParams->host == NULL || pInitParams->client_id == NULL ||
3087-
pInitParams->username == NULL || pInitParams->password == NULL) {
3087+
pInitParams->username == NULL || pInitParams->password == NULL ||
3088+
pInitParams->port == 0) {
30883089
mqtt_err("init params is not complete");
30893090
if (mqtt_params != NULL) {
30903091
mqtt_free(mqtt_params);

src/sdk-impl/impl_logpost.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99

1010
#define LOG_PUBLISH_MSG_MAXLEN (255)
1111

12+
#define IMPL_LOGPOST_MALLOC(size) LITE_malloc(size, MEM_MAGIC, "impl.logpost")
13+
#define IMPL_LOGPOST_FREE(ptr) LITE_free(ptr)
14+
1215
static int iotx_mc_log_post(void *pclient, char *payload);
1316

1417
static const char THING_LOG_POST_PARAMS[] =
@@ -29,7 +32,7 @@ int IOT_MQTT_LogPost(void *pHandle, const char *level, const char *module, const
2932
return FAIL_RETURN;
3033
}
3134

32-
logbuf = LITE_malloc(LOG_PUBLISH_MSG_MAXLEN + 1);
35+
logbuf = IMPL_LOGPOST_MALLOC(LOG_PUBLISH_MSG_MAXLEN + 1);
3336
if (logbuf == NULL) {
3437
return FAIL_RETURN;
3538
}
@@ -38,7 +41,7 @@ int IOT_MQTT_LogPost(void *pHandle, const char *level, const char *module, const
3841
/* generate log post json data */
3942
ret = HAL_Snprintf(logbuf, LOG_PUBLISH_MSG_MAXLEN, THING_LOG_POST_PARAMS, msgid, HAL_UTC_Get(), level, module, msg);
4043
if (ret < 0) {
41-
LITE_free(logbuf);
44+
IMPL_LOGPOST_FREE(logbuf);
4245
return FAIL_RETURN;
4346
}
4447

@@ -56,7 +59,7 @@ int IOT_MQTT_LogPost(void *pHandle, const char *level, const char *module, const
5659
log_err((char *)module, "log post to cloud success");
5760
}
5861

59-
LITE_free(logbuf);
62+
IMPL_LOGPOST_FREE(logbuf);
6063
return ret;
6164
}
6265

0 commit comments

Comments
 (0)